Just another custom docker environment for machine learning and data science projects. Cuda in docker is also supported.
docker - machine learning - environment - cuda
Author: Maximilian Bundscherer
scripts/
: Scripts includeddocker/
: Docker stuff included
You can use jupyter lab or run python scripts in attached custom docker container.
- Navigate to scripts folder
cd scripts/
- Build docker container
./build-docker.sh
- Do all steps in Let's get started (above)
- Start docker container
./start-jupyter-lab.sh ~/Desktop
- Replace
~/Desktop
by repo-path without/
at end
- Replace
- Go to http://127.0.0.1:50888/lab
- Login with token
abc
- Login with token
- Do all steps in Let's get started (above)
- Start docker container
./start-script.sh ~/Desktop script.py
- Replace
~/Desktop
by repo-path without/
at end - Replace
script.py
by script filename in repo-sub-path
- Replace
- Read log
cat run.log
- If you want to use cuda inside of a docker container, start
nvidia-docker
instead ofdocker
- If you want to specify which gpus you want to use, add prefix
NV_GPU=3,4
(check gpus on server withnvidia-smi
before) - The scripts in the repo has built-in cuda support (
scripts/start-jupyter-lab.sh
andscripts/start-script.sh
) (but please change which gpus you use)
- Navigate to scripts folder
cd scripts/
./check-docker.sh
: Check if docker container is running and check if image is available./remove-docker.sh
: Remove running docker container and remove image
import sys
import torch
print(f"PyTorch Version: {torch.__version__}")
print()
print(f"Python {sys.version}")
print("GPU is", "available" if torch.cuda.is_available() else "NOT AVAILABLE")