lazyoracle / test-torch

Barebone repository to test pytorch installation with GPU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

test-torch: Barebones repository to test installation of PyTorch with GPU functionality

Requirements

  • NVIDIA CUDA GPU enabled system
  • Miniconda

Usage

Check out the code

git clone https://github.com/lazyoracle/test-torch
cd test-torch

Build the environment

The environment.yml file works as is for Windows and Linux but for MacOS, remove CUDA dependency using the following command:

sed '/cuda/d' environment.yml | tee environment.yml

Creating a new conda environment is then straightforward using:

conda env create -f environment.yml

Test your PyTorch installation

conda activate torch
pytest src/

If you do not have a supported GPU in your system:

pytest src/ -m "not needs_gpu"

If you just want to run the train and test script:

python src/gputorch.py -p <path> -e <epochs>

About

Barebone repository to test pytorch installation with GPU

License:MIT License


Languages

Language:Python 100.0%