Coder Social home page Coder Social logo

pytorch-lightning-template's Introduction

PyTorch-Lightning-Template

A PyTorch-Lightning template that supports yapf autoformatting and includes a docker container to run the code.

To see examples on how to use the configs, have a look at the config readme

Setup

Setup Using Docker

Build the Docker Image

To build the Docker image run:

./docker_build.sh -n <image-name> -w <wandb-key>

Start Docker Container

To start the Docker container run the following command:

./docker_run.sh -n <container_name> -i <image_name> -d <comma_separated_device_ids>
# e.g. ./docker_run.sh -n pytorch_lightning_template -i pytorch_lightning_template -d "0,1"

or

docker run --rm --name <container-name> --gpus '"device=<device-ids>"' -v $(pwd):/workspace  -it <image-name> bash

That's it!๐ŸŽŠ๏ธ
Now you are setup and ready to develop using Docker!

Local Setup

If you don't want to use Docker and instead want to set up the project locally to use yapf and pre-commit you have to first install PyTorch:

conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

Then you have to install all other dependencies:

pip install -r requirements.txt

Finally, you have to set up 'pre-commit` to run yapf each time before committing:

pre-commit install

That's it!๐ŸŽŠ๏ธ Now you are setup and ready to go!

pytorch-lightning-template's People

Contributors

d0mih avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.