Installation
Required
1. Install PyTorch (prerequisite)
Sapsan can be run on both cpu and gpu. Below are the requirements for each version
Device | ||
---|---|---|
CPU | torch>=1.9.0 | torchvision>=0.10.0 |
GPU | torch>=1.9.0+cu111 | torchvision>=0.10.0+cu111 |
Please follow the instructions on PyTorch to install either version. CUDA>=11.1
can be installed directly with PyTorch as well.
Install CUDA-Toolkit
If you are planning to train on GPU, then you need to check that you have an nvidia-cuda-toolkit
installed:
Device
If GPU is available, Sapsan will always try to run on a GPU by default (that includes the tests). However, you can specify the device='cpu'
in model config.
2a. Install via pip (recommended)
2b. Clone from github (alternative)
If you experience any issues, you can try installing packages individually with:
Version
Make sure you are using the latest release version!
Optional
Install Graphviz
Info
pip version of graphviz that installs with Sapsan is not enough!
In order to create model graphs, Sapsan is using graphviz. If you would like to utilize this functionality, pip graphviz wrapper is not enough. To install the core package for graphviz:
Install Docker
In order to run Sapsan through Docker or build your own container to share, you will need to install it
Next, you can build a docker setup with the following:
this will create a container named sapsan-docker
.
If you want to run the container, type:
localhost:7654
Troubleshooting
libGL.so error
If you get the following error:
opencv-python
package has some dependency issues. To resolve, try the following:
My Kernel is Dying!
If when attempting to train the model (executing Train.run()
) the kernel is dying without any errors, check if you have a GPU on your machine while not having a nvidia-cuda-toolkit
installed. To resolve, you can either install it:
device='cpu'
in your model config. By defaul Sapsan always tries to train the models on a GPU if one is available.