English | 简体ä¸ć–‡
Note
This is a fork from cnstark/pytorch-docker supporting almost all combinations of pytorch 1.4-2.5, python 3.8-3.12, ubuntu 18.04-22.04, centos 8, and cuda 10.0-12.4.
Pure pytorch docker images with different os, cuda, and python versions.
Github: https://github.com/xiongsp/pytorch-docker
Docker Hub: https://hub.docker.com/r/spxiong/pytorch
- 2024/12/01: Support for pytorch 1.4-2.0.
- 2024/11/05: Support for pytorch 2.5.x. For 2.1-, please refer to this DockerHub and Github Repo.
- 2024/10/10: Support for pytorch 2.1.x 2.2.x 2.3.x 2.4.x (I'm back).
- Docker
- Nvidia-docker (If a CUDA is required)
As same as Pytorch Official.
docker run -it --rm \
--gpus all \
--net host
-v /path/to/project:/path/to/project \
-v /path/to/dataset:/path/to/dataset \
spxiong/pytorch:[TAG]
Note: /path/to/project
and /path/to/dataset
is your own project path and dataset path, should be replaced in use.
Generate build script by following command (available versions see Available Versions):
python generate_build_script.py --os <ubuntu or centos> --os-version <e.g. 20.04, 8> --python <e.g. 3.9.12> --pytorch <e.g. 1.9.1> --cuda <e.g. 11.1, cpu>
usage: generate_build_script.py [-h] --os OS --os-version OS_VERSION --python PYTHON --pytorch PYTORCH [--cuda CUDA] [--cuda-flavor CUDA_FLAVOR]
Generate docker build script.
optional arguments:
-h, --help show this help message and exit
--os OS Operating system.
--os-version OS_VERSION
Operating system version.
--python PYTHON Python version.
--pytorch PYTORCH Pytorch version.
--cuda CUDA CUDA version, `cpu` means CPU version.
--cuda-flavor CUDA_FLAVOR
CUDA flavor, `runtime` or `devel`, default is None, means use base image
scripts/build_xxx.sh
If you want to build and release specific versions using github actions, you can fork this repository and submit a pull request. The pull request should include only scripts/build_xxx.sh
and .github/workflows/docker_build_xxx.yml
generated by generate_build_script.py