A sample PyTorch project that trains, validates, and tests ResNet-34 on the Fashion MNIST dataset.
python3 main.py
Use the --help
option to list available arguments.
1. Install Docker.
On Ubuntu:
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends nvidia-384 libcuda-384
If you wish to avoid automatic upgrades:
sudo apt-mark hold nvidia-384 libcuda-384
3. Install nvidia-docker.
The image includes the latest PyTorch, CUDA 9.0, and CuDNN 7. It requires nvidia driver >=384 on the host.
sudo docker build -t pytorch .
sudo docker run --rm --runtime nvidia --ipc host --pid host -dit \
-v $(pwd):/root --restart unless-stopped \
-h $(hostname)-pytorch --name $(hostname)-pytorch \
pytorch bash -c 'pip install -r requirements.txt && python3 main.py'