https://github.com/d0mih/pytorch-docker-template
Github repository template for a project using docker together with PyTorch
https://github.com/d0mih/pytorch-docker-template
Last synced: about 2 months ago
JSON representation
Github repository template for a project using docker together with PyTorch
- Host: GitHub
- URL: https://github.com/d0mih/pytorch-docker-template
- Owner: D0miH
- License: mit
- Created: 2023-02-15T07:03:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-17T17:36:13.000Z (over 1 year ago)
- Last Synced: 2025-02-06T12:34:14.665Z (3 months ago)
- Language: Shell
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyTorch-Docker-Template
A PyTorch template that supports yapf autoformatting, pre-commit, Weights and Biases and includes a Dockerfile to run the code in a Docker container# Setup
## Docker
To build the Docker container run:
```bash
./docker_build.sh -n -w
```## Local Setup
To set up the project locally without running in a Docker container and to use `yapf` and `pre-commit`, you have to first install all dependencies using `conda` and `pip`:
```bash
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
pip install -r requirements.txt
```Then you have to set up 'pre-commit` to run yapf each time before committing:
```bash
pre-commit install
```That's it!🎊️
Now you are setup and ready to go!# Start Docker Container
To start the Docker container run the following command:
```bash
./docker_run.sh -n -i -d
```
e.g.
```bash
./docker_run.sh -n pytorch_docker_template -i pytorch_docker_template -d "0,1"
```
or
```bash
docker run --rm --name --gpus '"device="' -v $(pwd):/workspace -it bash
```