- Linux
- GCC 7+
- Python 3.6+
- PyTorch 1.9+
- CUDA 10.2+
-
Create a conda virtual environment and activate
conda create -n tinynas python=3.6 -y conda activate tinynas
-
Install OpenMPI and mpi4py
a. Install using conda command(recommended)
conda install -c conda-forge mpi4py=3.0.3 openmpi=4.0.4
b. Build from source (More faster when Multi-Process)
- From Here download openmpi source code
tar -xzvf openmpi-4.0.1.tar.gz cd openmpi-4.0.1 ./configure --prefix=$HOME/openmpi make && make install
- add mpi to the system path
export PATH=$HOME/openmpi/bin:$PATH export LD_LIBRARY_PATH=$HOME/openmpi/lib:$LD_LIBRARY_PATH
- install mpi4py
# conda conda install -c conda-forge mpi4py # or pip pip install mpi4py
-
Run the following commands or Official Guide install torch and torchvision
conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=10.2 -c pytorch
If you see
"Not be found for jpeg"
, please install libjpeg first.sudo yum install libjpeg # for centos sudo apt install libjpeg-dev # for ubuntu
-
ModelScope (optional)
For light-weight, we modify and port some code of modelscope , if you want to experience more features, you can visite ModelScope , or run the following installation commands
pip install "modelscope[cv]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
-
Other Requirements
pip install -r requirements/nas.txt
-
Installation check
import tinynas print(tinynas.__version__)