An open API service indexing awesome lists of open source software.

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

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
```