Skip to content

Commit

Permalink
seem need to downgrade PyTorch - see microsoft/nlp-recipes#616
Browse files Browse the repository at this point in the history
  • Loading branch information
Yixuan Wang committed Oct 5, 2021
1 parent 12b6edd commit 1c31f92
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 269 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,16 @@ To prevent the repo from growing in size, recommend always "restart and clear ou

Installation using the following command
```
git submodule update --init --recursive
pip3 install -r requirements.txt -f https://download.pytorch.org/whl/torch_stable.html
```
Using the environment through the following command
```
conda activate $CONDA_ENV
source docker/entrypoint.sh
use_pytorch_dense_correspondence
```
Start the notebook
```
./start_notebook.py
```
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def set_parameters_from_training_config(self, training_config):

self._use_image_b_mask_inv = training_config["training"]["use_image_b_mask_inv"]

from spartan_dataset_masked import SpartanDatasetDataType
from dense_correspondence.dataset.spartan_dataset_masked import SpartanDatasetDataType

self._data_load_types = []
self._data_load_type_probabilities = []
Expand Down Expand Up @@ -586,7 +586,8 @@ def set_parameters_from_training_config(self, training_config):
self._data_load_types.append(SpartanDatasetDataType.SYNTHETIC_MULTI_OBJECT)
self._data_load_type_probabilities.append(p)

self._data_load_type_probabilities = np.array(self._data_load_type_probabilities)
self._data_load_type_probabilities = np.array(self._data_load_type_probabilities).astype(float)
# print(self._data_load_type_probabilities.dtype)
self._data_load_type_probabilities /= np.sum(self._data_load_type_probabilities)

def set_train_mode(self):
Expand Down
49 changes: 14 additions & 35 deletions dense_correspondence/dataset/simple_datasets_test.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def non_match_loss_descriptor_only(self, image_a_pred, image_b_pred, non_matches
non_match_loss_vec, num_hard_negatives, _, _ = PCL.non_match_descriptor_loss(image_a_pred, image_b_pred, non_matches_a,
non_matches_b, M=M_descriptor, invert=invert)

num_non_matches = long(non_match_loss_vec.size()[0])
num_non_matches = int(non_match_loss_vec.size()[0])

non_match_loss = non_match_loss_vec.sum()

Expand Down
Loading

0 comments on commit 1c31f92

Please sign in to comment.