Skip to content
Merged
Changes from 2 commits
Commits
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
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,47 @@ Running:

in a cell will verify this has worked and show you what kind of hardware you have access to.

#### Google Colab Setup (CUDA 12.x, PyTorch 2.6, MONAI 1.5)

In Google Colab, the default environment may cause version conflicts with MONAI.
To ensure compatibility, install PyTorch and MONAI explicitly as follows:

# Install PyTorch 2.6.0 with CUDA 12.4
pip install --index-url https://download.pytorch.org/whl/cu124 \
torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0

# Install MONAI and common dependencies
pip install "monai[all]" nibabel pydicom ipywidgets==8.1.2


### Known issues and fixes

- Torchaudio mismatch
Colab may come with torchaudio 2.8.0, which is incompatible with torch 2.6.0.
Installing the versions above resolves this issue.

- filelock conflicts with nni
Some preinstalled packages (such as pytensor with newer filelock) may conflict.
Use the following commands to fix:

pip uninstall -y pytensor
pip install -U filelock

- Too many workers warning
Colab has limited CPU resources, and high num_workers settings may freeze execution.
It is recommended to use --num_workers=2 when running tutorials.


### Quick smoke test

After installation, verify the environment by running:

git clone https://github.com/Project-MONAI/tutorials.git
cd tutorials/3d_segmentation/torch
python -u unet_training_array.py --max_epochs 2 --batch_size 1 --num_workers 2

If the logs show decreasing training loss and a Dice score, the setup is correct.

#### Data

Some notebooks will require additional data.
Expand Down