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

add monai-based scripts for dataset conversion, training, and inference #60

Merged
merged 106 commits into from
Oct 9, 2023

Conversation

naga-karthik
Copy link
Collaborator

This PR adds all the required scripts for bids-msd dataset conversion, training and running inference with MONAI models.

monai/main.py Outdated Show resolved Hide resolved
monai/transforms.py Outdated Show resolved Hide resolved
monai/transforms.py Outdated Show resolved Hide resolved
@naga-karthik
Copy link
Collaborator Author

naga-karthik commented Oct 9, 2023

Hey @jcohenadad, yes the PR is ready. We will be merging it this week. Meanwhile, the inference script is also ready to use.
For --chkp-path please use

/home/GRAMES.POLYMTL.CA/u114716/duke/projects/ivadomed/contrast-agnostic-seg/models/monai

as the model is currently stored there

@jcohenadad
Copy link
Member

I'm having issues installing the deps:

Terminal output
(/Users/julien/code/contrast-agnostic-softseg-spinalcord/venv) julien-macbook:~/code/contrast-agnostic-softseg-spinalcord/monai $ pip install -r requirements_inference.txt 
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu
Collecting dynamic_network_architectures==0.2 (from -r requirements_inference.txt (line 1))
  Using cached dynamic_network_architectures-0.2.tar.gz (20 kB)
  Preparing metadata (setup.py) ... done
Collecting joblib==1.3.0 (from -r requirements_inference.txt (line 2))
  Obtaining dependency information for joblib==1.3.0 from https://files.pythonhosted.org/packages/1e/f2/6ec7eb9e48c88c750da04050a5ba8250ca9949dfcf6e624ccee12d2fc653/joblib-1.3.0-py3-none-any.whl.metadata
  Using cached joblib-1.3.0-py3-none-any.whl.metadata (5.4 kB)
Collecting loguru==0.7.0 (from -r requirements_inference.txt (line 3))
  Using cached loguru-0.7.0-py3-none-any.whl (59 kB)
Collecting monai[nibabel]==1.2.0 (from -r requirements_inference.txt (line 4))
  Obtaining dependency information for monai[nibabel]==1.2.0 from https://files.pythonhosted.org/packages/2e/39/444fc5b2fb0e9d9d432a2e1efaf75d68b0aee94d7559c8b9969e2f62c5a4/monai-1.2.0-202306081546-py3-none-any.whl.metadata
  Using cached monai-1.2.0-202306081546-py3-none-any.whl.metadata (10 kB)
Collecting scipy==1.11.2 (from -r requirements_inference.txt (line 5))
  Obtaining dependency information for scipy==1.11.2 from https://files.pythonhosted.org/packages/03/c3/5162f7d23a12c62cf0630f6cce20932f166fca7cb5513ed9af56b5618ba6/scipy-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl.metadata
  Downloading scipy-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl.metadata (54 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.1/54.1 kB 1.0 MB/s eta 0:00:00
Collecting numpy==1.24.4 (from -r requirements_inference.txt (line 6))
  Obtaining dependency information for numpy==1.24.4 from https://files.pythonhosted.org/packages/9a/cd/d5b0402b801c8a8b56b04c1e85c6165efab298d2f0ab741c2406516ede3a/numpy-1.24.4-cp39-cp39-macosx_10_9_x86_64.whl.metadata
  Downloading numpy-1.24.4-cp39-cp39-macosx_10_9_x86_64.whl.metadata (5.6 kB)
ERROR: Could not find a version that satisfies the requirement torch==2.0.0+cpu (from versions: 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 2.0.0, 2.0.1, 2.1.0)
ERROR: No matching distribution found for torch==2.0.0+cpu
(/Users/julien/code/contrast-agnostic-softseg-spinalcord/venv) julien-macbook:~/code/contrast-agnostic-softseg-spinalcord/monai $ python
Python 3.9.18 (main, Sep 11 2023, 08:38:23) 
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
(/Users/julien/code/contrast-agnostic-softseg-spinalcord/venv) julien-macbook:~/code/contrast-agnostic-softseg-spinalcord/monai $ git log
commit 4694169352fb962f607e7684fe778677adc123dc (HEAD -> nk/monai, origin/nk/monai)
Author: Naga Karthik <[email protected]>
Date:   Sun Oct 8 15:49:00 2023 -0400

    fix bug with torch.clamp setting bg values to 0.5

@valosekj
Copy link
Member

valosekj commented Oct 9, 2023

I'm having issues installing the deps:

I had the same issue on my local macboook, I had to remove packages versions; see updated requirements from canproco repo.

Then I ran:

 conda create -n monai python=3.8
 conda activate monai
 pip install -r requirements.txt

@jcohenadad
Copy link
Member

I'm having issues installing the deps:

I had the same issue on my local macboook, I had to remove packages versions; see updated requirements from canproco repo.

Then I ran:

 conda create -n monai python=3.8
 conda activate monai
 pip install -r requirements.txt

Thank you @valosekj -- there see to be some confusion about Python's version:
https://github.com/sct-pipeline/contrast-agnostic-softseg-spinalcord/pull/60/files#diff-45765be45b87970b013c24cdb66c4f4ad139e802f0f013e0bbf56ecf249478eeR12

@jcohenadad
Copy link
Member

I have another error with python 3.8:

Terminal output
julien-macbook:~ $ conda create -n monai python=3.8
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/julien/miniconda3/envs/monai

  added / updated specs:
    - python=3.8


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pip-23.2.1                 |   py38hecd8cb5_0         2.6 MB
    python-3.8.18              |       h5ee71fb_0        14.4 MB
    setuptools-68.0.0          |   py38hecd8cb5_0         946 KB
    wheel-0.41.2               |   py38hecd8cb5_0         109 KB
    ------------------------------------------------------------
                                           Total:        18.0 MB

The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/osx-64::ca-certificates-2023.08.22-hecd8cb5_0 
  libcxx             pkgs/main/osx-64::libcxx-14.0.6-h9765a3e_0 
  libffi             pkgs/main/osx-64::libffi-3.4.4-hecd8cb5_0 
  ncurses            pkgs/main/osx-64::ncurses-6.4-hcec6c5f_0 
  openssl            pkgs/main/osx-64::openssl-3.0.11-hca72f7f_2 
  pip                pkgs/main/osx-64::pip-23.2.1-py38hecd8cb5_0 
  python             pkgs/main/osx-64::python-3.8.18-h5ee71fb_0 
  readline           pkgs/main/osx-64::readline-8.2-hca72f7f_0 
  setuptools         pkgs/main/osx-64::setuptools-68.0.0-py38hecd8cb5_0 
  sqlite             pkgs/main/osx-64::sqlite-3.41.2-h6c40b1e_0 
  tk                 pkgs/main/osx-64::tk-8.6.12-h5d9f67b_0 
  wheel              pkgs/main/osx-64::wheel-0.41.2-py38hecd8cb5_0 
  xz                 pkgs/main/osx-64::xz-5.4.2-h6c40b1e_0 
  zlib               pkgs/main/osx-64::zlib-1.2.13-h4dc903c_0 


Proceed ([y]/n)? y


Downloading and Extracting Packages
                                                                                                    
Preparing transaction: done                                                                         
Verifying transaction: done                                                                         
Executing transaction: done                                                                         
#
# To activate this environment, use
#
#     $ conda activate monai
#
# To deactivate an active environment, use
#
#     $ conda deactivate

julien-macbook:~ $ conda activate monai
(monai) julien-macbook:~ $ cd code/contrast-agnostic-softseg-spinalcord/
(monai) julien-macbook:~/code/contrast-agnostic-softseg-spinalcord $ cd monai/
(monai) julien-macbook:~/code/contrast-agnostic-softseg-spinalcord/monai $ pip install -r requirements_inference.txt 
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu
Collecting dynamic_network_architectures==0.2 (from -r requirements_inference.txt (line 1))
  Using cached dynamic_network_architectures-0.2.tar.gz (20 kB)
  Preparing metadata (setup.py) ... done
Collecting joblib==1.3.0 (from -r requirements_inference.txt (line 2))
  Obtaining dependency information for joblib==1.3.0 from https://files.pythonhosted.org/packages/1e/f2/6ec7eb9e48c88c750da04050a5ba8250ca9949dfcf6e624ccee12d2fc653/joblib-1.3.0-py3-none-any.whl.metadata
  Using cached joblib-1.3.0-py3-none-any.whl.metadata (5.4 kB)
Collecting loguru==0.7.0 (from -r requirements_inference.txt (line 3))
  Using cached loguru-0.7.0-py3-none-any.whl (59 kB)
Collecting monai[nibabel]==1.2.0 (from -r requirements_inference.txt (line 4))
  Obtaining dependency information for monai[nibabel]==1.2.0 from https://files.pythonhosted.org/packages/2e/39/444fc5b2fb0e9d9d432a2e1efaf75d68b0aee94d7559c8b9969e2f62c5a4/monai-1.2.0-202306081546-py3-none-any.whl.metadata
  Using cached monai-1.2.0-202306081546-py3-none-any.whl.metadata (10 kB)
ERROR: Ignored the following versions that require a different python version: 1.11.0 Requires-Python <3.13,>=3.9; 1.11.0rc1 Requires-Python <3.13,>=3.9; 1.11.0rc2 Requires-Python <3.13,>=3.9; 1.11.1 Requires-Python <3.13,>=3.9; 1.11.2 Requires-Python <3.13,>=3.9; 1.11.3 Requires-Python <3.13,>=3.9
ERROR: Could not find a version that satisfies the requirement scipy==1.11.2 (from versions: 0.8.0, 0.9.0, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.13.1, 0.13.2, 0.13.3, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0rc1, 1.8.0rc2, 1.8.0rc3, 1.8.0rc4, 1.8.0, 1.8.1, 1.9.0rc1, 1.9.0rc2, 1.9.0rc3, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0rc1, 1.10.0rc2, 1.10.0, 1.10.1)
ERROR: No matching distribution found for scipy==1.11.2

@jcohenadad
Copy link
Member

same issue when targetting requirements.txt instead of requirements_inference.txt

Terminal output
(monai) julien-macbook:~/code/contrast-agnostic-softseg-spinalcord/monai $ pip install -r requirements.txt 
Collecting dynamic_network_architectures==0.2 (from -r requirements.txt (line 1))
  Using cached dynamic_network_architectures-0.2.tar.gz (20 kB)
  Preparing metadata (setup.py) ... done
Collecting joblib==1.3.0 (from -r requirements.txt (line 2))
  Obtaining dependency information for joblib==1.3.0 from https://files.pythonhosted.org/packages/1e/f2/6ec7eb9e48c88c750da04050a5ba8250ca9949dfcf6e624ccee12d2fc653/joblib-1.3.0-py3-none-any.whl.metadata
  Using cached joblib-1.3.0-py3-none-any.whl.metadata (5.4 kB)
Collecting loguru==0.7.0 (from -r requirements.txt (line 3))
  Using cached loguru-0.7.0-py3-none-any.whl (59 kB)
Collecting matplotlib==3.7.2 (from -r requirements.txt (line 4))
  Obtaining dependency information for matplotlib==3.7.2 from https://files.pythonhosted.org/packages/b2/b6/c6596fbc30899e6da31450053054d7da61a21a3f510544fb7cb7658a3de3/matplotlib-3.7.2-cp38-cp38-macosx_10_12_x86_64.whl.metadata
  Downloading matplotlib-3.7.2-cp38-cp38-macosx_10_12_x86_64.whl.metadata (5.6 kB)
Collecting monai[all]==1.2.0 (from -r requirements.txt (line 5))
  Obtaining dependency information for monai[all]==1.2.0 from https://files.pythonhosted.org/packages/2e/39/444fc5b2fb0e9d9d432a2e1efaf75d68b0aee94d7559c8b9969e2f62c5a4/monai-1.2.0-202306081546-py3-none-any.whl.metadata
  Using cached monai-1.2.0-202306081546-py3-none-any.whl.metadata (10 kB)
Collecting numpy==1.24.4 (from -r requirements.txt (line 6))
  Obtaining dependency information for numpy==1.24.4 from https://files.pythonhosted.org/packages/11/10/943cfb579f1a02909ff96464c69893b1d25be3731b5d3652c2e0cf1281ea/numpy-1.24.4-cp38-cp38-macosx_10_9_x86_64.whl.metadata
  Downloading numpy-1.24.4-cp38-cp38-macosx_10_9_x86_64.whl.metadata (5.6 kB)
Collecting pytorch_lightning==2.0.4 (from -r requirements.txt (line 7))
  Obtaining dependency information for pytorch_lightning==2.0.4 from https://files.pythonhosted.org/packages/e9/70/9c2587d7a566c1e656b5fcdbc1d01afd34675d8418b8fc4da3eb4d9bc808/pytorch_lightning-2.0.4-py3-none-any.whl.metadata
  Downloading pytorch_lightning-2.0.4-py3-none-any.whl.metadata (23 kB)
Collecting scikit_learn==1.3.0 (from -r requirements.txt (line 8))
  Obtaining dependency information for scikit_learn==1.3.0 from https://files.pythonhosted.org/packages/33/cb/0e41fad5b30fd66925e47952ddc720d078bdfd8397584a4873ec1cf590ca/scikit_learn-1.3.0-cp38-cp38-macosx_10_9_x86_64.whl.metadata
  Downloading scikit_learn-1.3.0-cp38-cp38-macosx_10_9_x86_64.whl.metadata (11 kB)
ERROR: Ignored the following versions that require a different python version: 1.11.0 Requires-Python <3.13,>=3.9; 1.11.0rc1 Requires-Python <3.13,>=3.9; 1.11.0rc2 Requires-Python <3.13,>=3.9; 1.11.1 Requires-Python <3.13,>=3.9; 1.11.2 Requires-Python <3.13,>=3.9; 1.11.3 Requires-Python <3.13,>=3.9; 1.25.0 Requires-Python >=3.9; 1.25.0rc1 Requires-Python >=3.9; 1.25.1 Requires-Python >=3.9; 1.25.2 Requires-Python >=3.9; 1.26.0 Requires-Python <3.13,>=3.9; 1.26.0b1 Requires-Python <3.13,>=3.9; 1.26.0rc1 Requires-Python <3.13,>=3.9; 3.8.0 Requires-Python >=3.9; 3.8.0rc1 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement scipy==1.11.2 (from versions: 0.8.0, 0.9.0, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.13.1, 0.13.2, 0.13.3, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0rc1, 1.8.0rc2, 1.8.0rc3, 1.8.0rc4, 1.8.0, 1.8.1, 1.9.0rc1, 1.9.0rc2, 1.9.0rc3, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0rc1, 1.10.0rc2, 1.10.0, 1.10.1)
ERROR: No matching distribution found for scipy==1.11.2

@naga-karthik
Copy link
Collaborator Author

@jcohenadad can you try installing the dependencies now? I think the +cpu in torch package was causing the issue. I removed it in latest commit.

Please stick to python=3.9 as my code is based on 3.9. (however, for simply running the inference script, the python versions shouldn't matter much, as we're using basic python commands. But using 3.9 will keep it consistent with the rest of the monai code)

@jcohenadad
Copy link
Member

2e35282 fixed it 🎉

Terminal output
(py39) julien-macbook:~/code/contrast-agnostic-softseg-spinalcord/monai $ pip install -r requirements_inference.txt 
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu
Collecting dynamic_network_architectures==0.2 (from -r requirements_inference.txt (line 1))
  Using cached dynamic_network_architectures-0.2.tar.gz (20 kB)
  Preparing metadata (setup.py) ... done
Collecting joblib==1.3.0 (from -r requirements_inference.txt (line 2))
  Obtaining dependency information for joblib==1.3.0 from https://files.pythonhosted.org/packages/1e/f2/6ec7eb9e48c88c750da04050a5ba8250ca9949dfcf6e624ccee12d2fc653/joblib-1.3.0-py3-none-any.whl.metadata
  Using cached joblib-1.3.0-py3-none-any.whl.metadata (5.4 kB)
Collecting loguru==0.7.0 (from -r requirements_inference.txt (line 3))
  Using cached loguru-0.7.0-py3-none-any.whl (59 kB)
Collecting monai[nibabel]==1.2.0 (from -r requirements_inference.txt (line 4))
  Obtaining dependency information for monai[nibabel]==1.2.0 from https://files.pythonhosted.org/packages/2e/39/444fc5b2fb0e9d9d432a2e1efaf75d68b0aee94d7559c8b9969e2f62c5a4/monai-1.2.0-202306081546-py3-none-any.whl.metadata
  Using cached monai-1.2.0-202306081546-py3-none-any.whl.metadata (10 kB)
Collecting scipy==1.11.2 (from -r requirements_inference.txt (line 5))
  Obtaining dependency information for scipy==1.11.2 from https://files.pythonhosted.org/packages/03/c3/5162f7d23a12c62cf0630f6cce20932f166fca7cb5513ed9af56b5618ba6/scipy-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl.metadata
  Using cached scipy-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl.metadata (54 kB)
Collecting numpy==1.24.4 (from -r requirements_inference.txt (line 6))
  Obtaining dependency information for numpy==1.24.4 from https://files.pythonhosted.org/packages/9a/cd/d5b0402b801c8a8b56b04c1e85c6165efab298d2f0ab741c2406516ede3a/numpy-1.24.4-cp39-cp39-macosx_10_9_x86_64.whl.metadata
  Using cached numpy-1.24.4-cp39-cp39-macosx_10_9_x86_64.whl.metadata (5.6 kB)
Collecting torch==2.0.0 (from -r requirements_inference.txt (line 8))
  Downloading https://download.pytorch.org/whl/cpu/torch-2.0.0-cp39-none-macosx_10_9_x86_64.whl (139.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.8/139.8 MB 6.1 MB/s eta 0:00:00
Collecting nibabel (from monai[nibabel]==1.2.0->-r requirements_inference.txt (line 4))
  Using cached nibabel-5.1.0-py3-none-any.whl (3.3 MB)
Collecting filelock (from torch==2.0.0->-r requirements_inference.txt (line 8))
  Obtaining dependency information for filelock from https://files.pythonhosted.org/packages/5e/5d/97afbafd9d584ff1b45fcb354a479a3609bd97f912f8f1f6c563cb1fae21/filelock-3.12.4-py3-none-any.whl.metadata
  Downloading filelock-3.12.4-py3-none-any.whl.metadata (2.8 kB)
Collecting typing-extensions (from torch==2.0.0->-r requirements_inference.txt (line 8))
  Obtaining dependency information for typing-extensions from https://files.pythonhosted.org/packages/24/21/7d397a4b7934ff4028987914ac1044d3b7d52712f30e2ac7a2ae5bc86dd0/typing_extensions-4.8.0-py3-none-any.whl.metadata
  Downloading typing_extensions-4.8.0-py3-none-any.whl.metadata (3.0 kB)
Collecting sympy (from torch==2.0.0->-r requirements_inference.txt (line 8))
  Downloading https://download.pytorch.org/whl/sympy-1.12-py3-none-any.whl (5.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 12.9 MB/s eta 0:00:00
Collecting networkx (from torch==2.0.0->-r requirements_inference.txt (line 8))
  Using cached networkx-3.1-py3-none-any.whl (2.1 MB)
Collecting jinja2 (from torch==2.0.0->-r requirements_inference.txt (line 8))
  Downloading https://download.pytorch.org/whl/Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 4.6 MB/s eta 0:00:00
Collecting MarkupSafe>=2.0 (from jinja2->torch==2.0.0->-r requirements_inference.txt (line 8))
  Obtaining dependency information for MarkupSafe>=2.0 from https://files.pythonhosted.org/packages/62/9b/4908a57acf39d8811836bc6776b309c2e07d63791485589acf0b6d7bc0c6/MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl.metadata
  Downloading MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl.metadata (3.0 kB)
Collecting packaging>=17 (from nibabel->monai[nibabel]==1.2.0->-r requirements_inference.txt (line 4))
  Obtaining dependency information for packaging>=17 from https://files.pythonhosted.org/packages/ec/1a/610693ac4ee14fcdf2d9bf3c493370e4f2ef7ae2e19217d7a237ff42367d/packaging-23.2-py3-none-any.whl.metadata
  Downloading packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Collecting mpmath>=0.19 (from sympy->torch==2.0.0->-r requirements_inference.txt (line 8))
  Downloading https://download.pytorch.org/whl/mpmath-1.3.0-py3-none-any.whl (536 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 536.2/536.2 kB 9.1 MB/s eta 0:00:00
Downloading joblib-1.3.0-py3-none-any.whl (301 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 301.9/301.9 kB 3.0 MB/s eta 0:00:00
Downloading scipy-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl (37.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 37.2/37.2 MB 12.1 MB/s eta 0:00:00
Downloading numpy-1.24.4-cp39-cp39-macosx_10_9_x86_64.whl (19.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.8/19.8 MB 12.8 MB/s eta 0:00:00
Using cached filelock-3.12.4-py3-none-any.whl (11 kB)
Downloading monai-1.2.0-202306081546-py3-none-any.whl (1.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 10.7 MB/s eta 0:00:00
Downloading typing_extensions-4.8.0-py3-none-any.whl (31 kB)
Using cached MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl (13 kB)
Downloading packaging-23.2-py3-none-any.whl (53 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.0/53.0 kB 4.8 MB/s eta 0:00:00
Building wheels for collected packages: dynamic_network_architectures
  Building wheel for dynamic_network_architectures (setup.py) ... done
  Created wheel for dynamic_network_architectures: filename=dynamic_network_architectures-0.2-py3-none-any.whl size=27245 sha256=6ab117e4881bee8c041e31e1b89ae820e4eac0ed4e321d9101965a4da927b482
  Stored in directory: /Users/julien/Library/Caches/pip/wheels/4e/c0/70/740949411012a24276008fa6e920f42701ae6fa18ce6122eb5
Successfully built dynamic_network_architectures
Installing collected packages: mpmath, typing-extensions, sympy, packaging, numpy, networkx, MarkupSafe, loguru, joblib, filelock, scipy, nibabel, jinja2, torch, monai, dynamic_network_architectures
Successfully installed MarkupSafe-2.1.3 dynamic_network_architectures-0.2 filelock-3.12.4 jinja2-3.1.2 joblib-1.3.0 loguru-0.7.0 monai-1.2.0 mpmath-1.3.0 networkx-3.1 nibabel-5.1.0 numpy-1.24.4 packaging-23.2 scipy-1.11.2 sympy-1.12 torch-2.0.0 typing-extensions-4.8.0

@jcohenadad
Copy link
Member

jcohenadad commented Oct 9, 2023

I understand the benefits in duplicating code to isolate other projects (eg https://github.com/ivadomed/canproco/pull/44/files), but it comes at a cost of a lack of testing/feedback from the team. I strongly suggest to keep only one codebase/documentation, and iterate on that codebase/documentation.

```

`--path-img` - Path to the image to be segmented
`--chkp-path` - Path to the model checkpoint. This folder should contain the `best_model_loss.ckpt`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where can we find this? pls include a temporary path to the latest model so we can test it-- until we upload as a release asset

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned that path to the model here #60 (comment)

@valosekj
Copy link
Member

valosekj commented Oct 9, 2023

@jcohenadad can you try installing the dependencies now? I think the +cpu in torch package was causing the issue. I removed it in latest commit.

Please stick to python=3.9 as my code is based on 3.9. (however, for simply running the inference script, the python versions shouldn't matter much, as we're using basic python commands. But using 3.9 will keep it consistent with the rest of the monai code)

Working for me as well! Thanks! I updated the canproco files in ivadomed/canproco@688d1a0 to be in line with this PR.

@naga-karthik naga-karthik marked this pull request as ready for review October 9, 2023 22:13
@sandrinebedard sandrinebedard changed the base branch from main to sb/remove_crop_preprocessing October 9, 2023 22:13
@naga-karthik
Copy link
Collaborator Author

merging to Sandrine's branch -- discussed in the internal meeting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants