solo模型训练
windows上运行报错记录
前言
提示:这里可以添加本文要记录的大概内容:
例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。
提示:以下是本篇文章正文内容,下面案例可供参考
一、solo需要安装mmdetection
Requirements
- Linux (Windows is not officially supported)
- Python 3.5+
- PyTorch 1.1 or higher (>=1.5 is not tested)
- CUDA 9.0 or higher
- NCCL 2
- GCC 4.9 or higher
- mmcv 0.2.16
We have tested the following versions of OS and softwares:
- OS: Ubuntu 16.04/18.04 and CentOS 7.2
- CUDA: 9.0/9.2/10.0/10.1
- NCCL: 2.1.15/2.2.13/2.3.7/2.4.2
- GCC(G++): 4.9/5.3/5.4/7.3
1.Install SOLO
a. Create a conda virtual environment and activate it.
conda create -n solo python=3.7 -y
conda activate solo
b. Install PyTorch and torchvision following the official instructions, e.g.,
conda install pytorch torchvision -c pytorch
c. Clone the SOLO repository.
git clone https://github.com/WXinlong/SOLO.git
cd SOLO
d. Install build requirements and then install SOLO.
(We install pycocotools via the github repo instead of pypi because the pypi version is old and not compatible with the latest numpy.)
pip install -r requirements/build.txt
pip install "git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI"
pip install -v -e . # or "python setup.py develop"
二、报错记录
1.ModuleNotFoundError: No module named ‘mmcv.cnn.weight_init’
解决方法:
将 from mmcv.cnn.weight_init import caffe2_xavier_init
更改为 from mmcv.cnn import caffe2_xavier_init