ivadomedsupports GPU/CPU on
Windows, and CPU only on
macOSand Windows Subsystem for Linux.
Step 1: Setup dedicated python environment
You can setup
ivadomedusing either Conda or Venv:
Setup Python Venv Virtual Environment.
ivadomedrequires Python >= 3.7 and <3.10.
First, make sure that a compatible version of Python 3 is installed on your system by running:python3 --versionpython --version
If your system’s Python is not 3.7, 3.8, or 3.9 (or if you don’t have Python 3 installed at all), please install Python before continuing.
Once you have a supported version of Python installed, run the following command:# Replacing ``3.X`` with the Python version number that you installed): python3.X -m venv ivadomed_env
If you use
Ubuntu, you may be prompted to install the
python3-venvmodule when creating the virtual environment. This is expected, so please follow the instructions provided by Python. For other operating systems,
venvwill be installed by default.python -m venv ivadomed_env
Activate the new virtual environment (default named
ivadomed_env)source ivadomed_env/bin/activatecd ivadomed_env/Scripts/ activate
Create new conda environment using
environment.ymlfileconda env create --name ivadomed_env
Activate the new conda environmentconda activate ivadomed_env
There are numerous constraints and limited package availabilities with ComputeCanada cluster environment.
It is best to attempt
venvbased installations and follow up with ComputeCanada technical support as MANY specially compiled packages (e.g. numpy) are exclusively available for Compute Canada HPC environment.
Step 2: Install
ivadomedand its requirements from PyPI:pip install --upgrade pip pip install ivadomed
Bleeding-edge developments are available on the project’s master branch on Github. Install
ivadomedfrom source:git clone https://github.com/ivadomed/ivadomed.git cd ivadomed pip install -e .
Step 3: Install
torchvision with CPU or GPU Support
ivadomedrequires CUDA11 to execute properly. If you have a nvidia GPU, try to look up its Cuda Compute Score here, which needs to be > 3.5 to support CUDA11. Then, make sure to upgrade to nvidia driver to be at least v450+ or newer.
You can use
nvidia-smiin both Linux and Windows to check for driver CUDA Version listed at the top right of the output console. On Linux, simply type in
nvidia-smiin any console to see the output. On windows, you will need to locate the nvidia-smi.exe tool by following the instructions on this page.
If you have a compatible NVIDIA GPU that supports CUDA11, and you have a recent enough driver installed, then run the following command:pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 --find-links https://download.pytorch.org/whl/torch_stable.html
If you plan to run
ivadomedon CPU only, install PyTorch per instructions provided below for your specific operating system:pip install torch==1.8.0+cpu torchvision==0.9.0+cpu --find-links https://download.pytorch.org/whl/torch_stable.htmlpip install torch==1.8.0 torchvision==0.9.0 --find-links https://download.pytorch.org/whl/torch_stable.html
Run this only if you have already downloaded/cloned the repo with access to the
requirement_gpu.txtfile, then run the following command while at the repository root level:pip install -r requirements_gpu.txt
Developer-only Installation Steps
The additional steps below are only necessary for contributors to the
pre-commitpackage is used to enforce a size limit on committed files. The
requirements_dev.txtalso contain additional dependencies related to documentation building and testing.
After you’ve installed
ivadomed, install the
pre-commithooks by running:pip install -r requirements_dev.txt pre-commit install