Create a TensorFlow conda environment
- If not already installed, download and install conda (anaconda)
- If not done, finalize conda installation and configuration (adjust the string of PATH_TO_CONDA)
$ source PATH_TO_CONDA/anaconda3/bin/activate
$ conda init
- Download TF2.16-cuda.yml
- Create the conda environment with the yml file you want (this example will create it in /tmp)
- $
conda env create --prefix /tmp/${USER}/conda_TF2.16-cuda -f TF2.16-cuda.yml
- $
- Activate the environment $
conda activate /tmp/${USER}/conda_TF2.16-cuda
- You can now enjoy your virtual environment ! For windows, remove the cupti package. If you have not a GPU (or not a nvidia one) remove lines cudnn and cudatoolkit
- When you want to stop an environment, you can deactivate it and restore the initial one (base) with :
$ conda deactivate
A short summary of conda utilization:
This procedure is the same for PyTorch, just download monai-dev.yml and adapt the previous lines. This file includes MONAI-dev prerequisits.
$ conda env create --prefix /tmp/${USER}/monai-dev -f monai-dev.yml
then finalize the MONAI-dev installation by first activate your env and then installing the MOANI-dev using (more information here):
$ conda activate /tmp/${USER}/monai-dev
$ pip install --no-build-isolation git+https://github.com/Project-MONAI/MONAI#egg=monai