Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test out newer versions of PyTorch (torch>=2.0.0) for compatibility with downstream projects (SCT, ADS) #1304

Merged
3 changes: 1 addition & 2 deletions ivadomed/loader/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import torch
from loguru import logger
from sklearn.model_selection import train_test_split
from torch._six import string_classes
from ivadomed import utils as imed_utils
from ivadomed.keywords import SplitDatasetKW, LoaderParamsKW, ROIParamsKW, ContrastParamsKW
import nibabel as nib
Expand Down Expand Up @@ -270,7 +269,7 @@ def imed_collate(batch: dict) -> dict | list | str | torch.Tensor:
return torch.LongTensor(batch)
elif isinstance(batch[0], float):
return torch.DoubleTensor(batch)
elif isinstance(batch[0], string_classes):
elif isinstance(batch[0], str):
return batch
elif isinstance(batch[0], collections.abc.Mapping):
return {key: imed_collate([d[key] for d in batch]) for key in batch[0]}
Expand Down
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ imageio>=2.31.4
joblib~=1.0
matplotlib>=3.3.0
nibabel~=3.2
onnxruntime~=1.7
onnx
onnxruntime>=1.7.0,<1.16.0
kanishk16 marked this conversation as resolved.
Show resolved Hide resolved
pandas>=1.1,<1.5.0
# We pin Pillow here because we're currently using an older version of `torch`, which in turn uses an
# older version of `tensorboard`, which in turn uses a deprecated feature of Pillow.
joshuacwnewton marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -25,6 +26,6 @@ tensorboard>=1.15.0
tqdm>=4.30
scipy
torchio>=0.18.68
torch>=1.8.1,<=1.11.0
torchvision>=0.9.1,<=0.12.0
torch>=1.8.1
torchvision>=0.9.1
wandb>=0.12.11