Skip to content

Commit d0db5fd

Browse files
authored
5596 simplify conda env (#5597)
Fixes #5596 Fixes #5088 ### Description simplify the conda env ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <wenqil@nvidia.com>
1 parent 6471c90 commit d0db5fd

File tree

5 files changed

+11
-61
lines changed

5 files changed

+11
-61
lines changed

.github/workflows/conda.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
os: [windows-latest, macOS-latest, ubuntu-latest]
22-
python-version: ["3.8"]
21+
os: [windows-latest, ubuntu-latest]
22+
python-version: ["3.9"]
2323
runs-on: ${{ matrix.os }}
2424
env:
2525
QUICKTEST: True

docs/source/installation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ cd MONAI/
203203
pip install -r requirements-dev.txt
204204
```
205205

206-
To install all optional dependencies with `conda` based on MONAI development environment settings:
206+
To install all optional dependencies with `conda` based on MONAI development environment settings (`environment-dev.yml`;
207+
this will install PyTorch as well as `pytorch-cuda`, please follow https://pytorch.org/get-started/locally/#start-locally for more details about installing PyTorch):
207208
```bash
208209
git clone https://github.com/Project-MONAI/MONAI.git
209210
cd MONAI/

environment-dev.yml

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,13 @@ name: monai
22
channels:
33
- pytorch
44
- defaults
5+
- nvidia
56
- conda-forge
67
dependencies:
78
- numpy>=1.17
89
- pytorch>=1.8
9-
- coverage>=5.5
10-
- parameterized
11-
- setuptools>=50.3.0,!=60.0.0
12-
- ignite==0.4.10
13-
- gdown>=4.4.0
14-
- scipy
15-
- nibabel
16-
- pillow!=8.3.0 # https://github.com/python-pillow/Pillow/issues/5571
17-
- tensorboard
18-
- scikit-image>=0.14.2
19-
- tqdm>=4.47.0
20-
- python-lmdb
21-
- flake8>=3.8.1
22-
- flake8-bugbear
23-
- flake8-comprehensions
24-
- pylint
25-
- mccabe
26-
- pep8-naming
27-
- pycodestyle
28-
- pyflakes
29-
- isort
30-
- types-pkg_resources
31-
- ninja
3210
- torchvision
33-
- psutil
34-
- Sphinx==3.5.3
35-
- recommonmark==0.6.0
36-
- sphinx-autodoc-typehints==1.11.1
37-
- sphinx_rtd_theme==0.5.2
38-
- pandas
39-
- requests
40-
- einops
41-
- transformers<4.22 # https://github.com/Project-MONAI/MONAI/issues/5157
42-
- mlflow
43-
- tensorboardX
44-
- pyyaml
45-
- fire
46-
- jsonschema
47-
- pynrrd
48-
- pydicom
49-
- h5py
50-
- optuna
11+
- pytorch-cuda=11.6
5112
- pip
5213
- pip:
53-
# pip for itk as conda-forge version only up to v5.1
54-
- itk>=5.2
55-
# black currently at v19 on conda vs v21 on pip
56-
- black
57-
# conda mypy v. slow
58-
- mypy>=0.790
59-
# OS-specific needs to be done via pip:
60-
# https://github.com/conda/conda/issues/8089
61-
- pytype>=2020.6.1; platform_system != "Windows"
62-
- openslide-python==1.1.2
63-
- cucim>=22.8.1; platform_system == "Linux"
64-
- imagecodecs; platform_system == "Linux"
65-
- tifffile; platform_system == "Linux"
66-
- matplotlib!=3.5.0
67-
- nni
14+
- -r requirements-dev.txt

tests/test_attentionunet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import torch
1515

1616
import monai.networks.nets.attentionunet as att
17-
from tests.utils import skip_if_no_cuda
17+
from tests.utils import skip_if_no_cuda, skip_if_quick
1818

1919

2020
class TestAttentionUnet(unittest.TestCase):
@@ -34,6 +34,7 @@ def test_attention_block(self):
3434
output = block(g, x)
3535
self.assertEqual(output.shape, x.shape)
3636

37+
@skip_if_quick
3738
def test_attentionunet(self):
3839
for dims in [2, 3]:
3940
shape = (3, 1) + (92,) * dims

tests/test_unetr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from monai.networks import eval_mode
1818
from monai.networks.nets.unetr import UNETR
19-
from tests.utils import SkipIfBeforePyTorchVersion, test_script_save
19+
from tests.utils import SkipIfBeforePyTorchVersion, skip_if_quick, test_script_save
2020

2121
TEST_CASE_UNETR = []
2222
for dropout_rate in [0.4]:
@@ -53,6 +53,7 @@
5353
TEST_CASE_UNETR.append(test_case)
5454

5555

56+
@skip_if_quick
5657
class TestUNETR(unittest.TestCase):
5758
@parameterized.expand(TEST_CASE_UNETR)
5859
def test_shape(self, input_param, input_shape, expected_shape):

0 commit comments

Comments
 (0)