-
Quickly set up medial imaging deep learning research environment on Linux(singularity container based)
-
GPU acceleration (CUDA and cuDNN included)
-
Supported frameworks and packages:
- PyTorch
- Scikit-learn
- OpenCV
- SimpleITK
- Scikit-image
- Anaconda packages: https://docs.anaconda.com/anaconda/packages/py3.6_linux-64/
-
your host system must has an NVIDIA GPU card and a driver installed(you don't need to install cuda and cudnn)
-
install singularity on your host
# ubuntu sudo apt-get install -y singularity-container
-
pull singularity image from singularity hub
singularity pull --name pytorch_gpu.simg shub://yinglilu/pytorch_gpu_singularity:1.3.0
# enter into singularityh container: imagine it as SSH into (passwordless) another machine
# --nv: leverage the nvidia gpu card
singularity shell --nv /containers/pytorch_gpu.simg
You will get:
Singularity: Invoking an interactive shell within container...
Singularity pytorch_gpu.simg:~>
You can type command now, for instance:
python /path/to/<your_script.py>
After finishing your work, type
exit
to exit the container.
-
Singularity will bind your host's $HOME to container's $HOME automatically. That's mean, if you do modification on your host's home directory, you can see the modifications in the container's home directory, and vice versa.
-
If current working directory is in your home directory or bind path, Singularity will replicate your current working directory within the container.
Therefore,
/path/to/
can be a relative path or absolute path of your home or bind path.
singularity exec --nv pytorch_gpu.simg python /path/to/<your_script.py>