mmclassification环境搭建(基于windows)
依赖环境:
- Python 3.6+
- PyTorch 1.5+
- CUDA 9.2+
本次实际使用环境:
windows11 x64
Python 3.8
PyTorch 1.8.2
CUDA 11.1
0.安装Python、Cuda、cudnn
略,按照版本要求安装就行。
1.创建Python虚拟环境并进入虚拟环境
python -m venv your/venv/path
your/venv/path/Activate.ps1
2.安装pytorch
pip install torch==1.8.2 torchvision==0.9.2 torchaudio===0.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu111
3.安装mmcv
venv环境下,min install mmcv-full
会安装在主环境,采用分步安装
参考:
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
4.拉取mmcls源码
git clone https://github.com/open-mmlab/mmclassification.git
cd mmclassification
pip install -v -e .
5.验证
python demo/image_demo.py demo/demo.JPEG resnet50_8xb32_in1k.py resnet50_8xb32_in1k_20210831-ea4938fc.pth --device cpu