Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Upgrade to Pytorch 1.8 #411

Merged
merged 27 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e7d098d
package upgrade
ant0nsc Mar 6, 2021
470551e
upgrade torchprof
ant0nsc Mar 7, 2021
83311fd
removing a test that now fails because AML is behind
ant0nsc Mar 7, 2021
52a3882
forking torchprof for now
ant0nsc Mar 8, 2021
eb8cf34
adding bias term
ant0nsc Mar 8, 2021
6a03041
updated pytorch lightning
ant0nsc Mar 8, 2021
676032d
updated metrics location
ant0nsc Mar 8, 2021
3c7abbd
avoiding the legacy use_ddp flag
ant0nsc Mar 8, 2021
22c6deb
trying to fix
ant0nsc Mar 8, 2021
8749465
update pillow to avoid component governance
ant0nsc Mar 9, 2021
14c4b9d
fix metrics problems
ant0nsc Mar 10, 2021
6b5584a
switch to new torchprof
ant0nsc Mar 10, 2021
a69dfd6
mypy
ant0nsc Mar 10, 2021
9e7b58a
exclude time from metrics for scalar models
ant0nsc Mar 10, 2021
e95a1ac
fix tolerance issues
ant0nsc Mar 10, 2021
63e200b
project file
ant0nsc Mar 10, 2021
30cba02
cleanup
ant0nsc Mar 10, 2021
54e5055
test fixes
ant0nsc Mar 10, 2021
68f76d4
CHANGELOG.md
ant0nsc Mar 10, 2021
34ee256
test fixes
ant0nsc Mar 10, 2021
45be974
test fixes
ant0nsc Mar 10, 2021
c0c0020
Merge branch 'main' into antonsc/pytorch18
ant0nsc Mar 11, 2021
32c144f
Merge remote-tracking branch 'origin/main' into antonsc/pytorch18
ant0nsc Mar 12, 2021
97756d2
downgrade PL to 1.1.8
ant0nsc Mar 12, 2021
f74c3c4
Merge branch 'antonsc/pytorch18' of https://github.com/microsoft/Inne…
ant0nsc Mar 12, 2021
bee0272
Merge remote-tracking branch 'origin/main' into antonsc/pytorch18
ant0nsc Mar 12, 2021
78d59fe
PR comments
ant0nsc Mar 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mypy
  • Loading branch information
ant0nsc committed Mar 10, 2021
commit a69dfd6d5ed6d8c59538e5832ae27815f2177563
4 changes: 2 additions & 2 deletions InnerEye/ML/lightning_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ def _get_metrics_at_optimal_cutoff(self) -> Tuple[torch.Tensor, torch.Tensor, to
return torch.tensor(np.nan), torch.tensor(np.nan), torch.tensor(np.nan), torch.tensor(np.nan)
fpr, tpr, thresholds = roc(preds, targets)
optimal_idx = torch.argmax(tpr - fpr) # type: ignore
optimal_threshold = thresholds[optimal_idx]
optimal_threshold = thresholds[optimal_idx] # type: ignore
acc = accuracy(preds > optimal_threshold, targets)
false_negative_optimal = 1 - tpr[optimal_idx]
false_negative_optimal = 1 - tpr[optimal_idx] # type: ignore
false_positive_optimal = fpr[optimal_idx]
return optimal_threshold, false_positive_optimal, false_negative_optimal, acc

Expand Down
2 changes: 1 addition & 1 deletion InnerEye/ML/lightning_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def training_or_validation_epoch_end(self, is_training: bool) -> None:
logger.flush()
super().training_or_validation_epoch_end(is_training)

def transfer_batch_to_device(self, batch: Any, device: Optional[torch.device]) -> Any:
def transfer_batch_to_device(self, batch: Any, device: torch.device) -> Any: # type: ignore
"""
For sequence models, transfer the nested lists of items to the given GPU device.
For all other models, this relies on the superclass to move the batch of data to the GPU.
Expand Down