Skip to content

Commit

Permalink
pytorch min version 1.7
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Brown <[email protected]>
  • Loading branch information
rijobro committed Apr 11, 2022
1 parent 7f43b00 commit 840e7df
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 17 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: [self-hosted, linux, x64, common]
strategy:
matrix:
pytorch-version: [1.6.0, 1.7.1, 1.8.1, 1.9.1, latest]
pytorch-version: [1.7.1, 1.8.1, 1.9.1, latest]
steps:
- uses: actions/checkout@v2
- name: Install the dependencies
Expand All @@ -25,8 +25,6 @@ jobs:
python -m pip uninstall -y torch torchvision
if [ ${{ matrix.pytorch-version }} == "latest" ]; then
python -m pip install torch torchvision
elif [ ${{ matrix.pytorch-version }} == "1.6.0" ]; then
python -m pip install torch==1.6.0 torchvision==0.7.0
elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
python -m pip install torch==1.7.1 torchvision==0.8.2
elif [ ${{ matrix.pytorch-version }} == "1.8.1" ]; then
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/pythonapp-min.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pytorch-version: [1.6.0, 1.7.1, 1.8.1, 1.9.1, 1.10.1, latest]
pytorch-version: [1.7.1, 1.8.1, 1.9.1, 1.10.1, latest]
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -148,8 +148,6 @@ jobs:
# min. requirements
if [ ${{ matrix.pytorch-version }} == "latest" ]; then
python -m pip install torch
elif [ ${{ matrix.pytorch-version }} == "1.6.0" ]; then
python -m pip install torch==1.6.0
elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
python -m pip install torch==1.7.1
elif [ ${{ matrix.pytorch-version }} == "1.8.1" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
# install the latest pytorch for testing
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
# fresh torch installation according to pyproject.toml
python -m pip install torch>=1.6 torchvision
python -m pip install torch>=1.7 torchvision
- name: Check packages
run: |
pip uninstall monai
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ the postprocessing steps should be used before calling the metrics methods
* Progress bar with tqdm

### Changed
* Now fully compatible with PyTorch 1.6
* Now fully compatible with PyTorch 1.7
* Base Docker image upgraded to `nvcr.io/nvidia/pytorch:20.08-py3` from `nvcr.io/nvidia/pytorch:20.03-py3`
* Code contributions now require signing off on the [Developer Certificate of Origin (DCO)](https://developercertificate.org/)
* Major work in type hinting finished
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-f https://download.pytorch.org/whl/cpu/torch-1.6.0%2Bcpu-cp37-cp37m-linux_x86_64.whl
torch>=1.6
-f https://download.pytorch.org/whl/cpu/torch-1.7.0%2Bcpu-cp37-cp37m-linux_x86_64.whl
torch>=1.7
pytorch-ignite==0.4.8
numpy>=1.17
itk>=5.2
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- conda-forge
dependencies:
- numpy>=1.17
- pytorch>=1.6
- pytorch>=1.7
- coverage>=5.5
- parameterized
- setuptools>=50.3.0,!=60.0.0
Expand Down
2 changes: 1 addition & 1 deletion monai/apps/mmars/mmars.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def download_mmar(
if has_home:
mmar_dir = Path(get_dir()) / "mmars"
else:
raise ValueError("mmar_dir=None, but no suitable default directory computed. Upgrade Pytorch to 1.6+ ?")
raise ValueError("mmar_dir=None, but no suitable default directory computed. Upgrade Pytorch to 1.7+ ?")
mmar_dir = Path(mmar_dir)
if api:
model_dict = _get_all_ngc_models(item.get(Keys.NAME, f"{item}") if isinstance(item, Mapping) else f"{item}")
Expand Down
4 changes: 2 additions & 2 deletions monai/data/torchscript_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def save_net_with_metadata(

json_data = json.dumps(metadict)

# Pytorch>1.6 can use dictionaries directly, otherwise need to use special map object
# Pytorch>1.7 can use dictionaries directly, otherwise need to use special map object
if pytorch_after(1, 7):
extra_files = {METADATA_FILENAME: json_data.encode()}

Expand Down Expand Up @@ -123,7 +123,7 @@ def load_net_with_metadata(
Returns:
Triple containing loaded object, metadata dict, and extra files dict containing other file data if present
"""
# Pytorch>1.6 can use dictionaries directly, otherwise need to use special map object
# Pytorch>1.7 can use dictionaries directly, otherwise need to use special map object
if pytorch_after(1, 7):
extra_files = {f: "" for f in more_extra_files}
extra_files[METADATA_FILENAME] = ""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires = [
"wheel",
"setuptools",
"torch>=1.6",
"torch>=1.7",
"ninja",
]

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
torch>=1.6
torch>=1.7
numpy>=1.17
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ setup_requires =
torch
ninja
install_requires =
torch>=1.6
torch>=1.7
numpy>=1.17

[options.extras_require]
Expand Down

0 comments on commit 840e7df

Please sign in to comment.