Install
Following steps are required to complete installing convmodel.
- Prepare Python3.8+ environment
- Install PyTorch
- Install convmodel
Prepare Python 3.8+
First, prepare Python 3.8+ environment.
Install PyTorch
Then install PyTorch >= 1.8,<=1.9. Please refer to official document to find out correct installation for your environment.
Some examples of installtion are as follows.
Install in Docker container without GPU
$ docker container run -w /work -v $(pwd):/work --rm -it python:3.8.6-slim-buster bash
(container)$ pip install torch==1.8.1
Install in Docker container enabling GPU and CUDA 11.1
Assume that CUDA 11.1 is installed in your environment.
$ docker container run --gpus all --ipc=host --rm -it -v $(pwd):/work -w /work nvidia/cuda:11.1-devel-ubuntu20.04 bash
--ipc
option is required because share memory would not be enough because DataLoader multiprocess requires them. Refer to the pytorch discussion for more details.
Then install Python3.
(container)$ apt update && apt install -y python3 python3-pip git
Install PyTorch which corresponds to your environment by following the installation guide. For example, in CUDA 11.1 environment, PyTorch can be installed as follows.
(container)$ pip3 install torch==1.8.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
Install convmodel
Finally, install convmodel from PyPI.
$ pip install convmodel
If you want to run tests, specify [test]
option to install dependencies.
$ pip install convmodel[test]