PolarMask: Single Shot Instance Segmentation with Polar Representation 论文复现笔记
官方代码:https://github.com/xieenze/PolarMask
官方论文解读:https://zhuanlan.zhihu.com/p/84890413
创建环境
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab
conda install cython
Install PyTorch stable
eg:conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch
安装mmcv:
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
pip install .
git clone https://github.com/xieenze/PolarMask.git
cd PolarMask
python setup.py develop
错误及解决方案
1、AssertionError(‘PyTypeTest on non extension type’), <traceback object at 0x7f66b577fd70>)
报这个错误的原因是因为没有安装pycocotools;
解决方法:pip install pycocotools
train
# 单gpu
python tools/train.py configs/polarmask/4gpu/polar_768_1x_r50.py
#多gpu
./tools/dist_train.sh configs/polarmask/4gpu/polar_768_1x_r50.py 4 --launcher pytorch --work_dir ./work_dirs/polar_768_1x_r50_4gpu
#制定个gpu 例:2个
CUDA_VISIBLE_DEVICES=0,1 python tools/train.py configs/polarmask/4gpu/polar_768_1x_r50.py --gpus 2
错误及解决方案
1、ModuleNotFoundError: No module named ‘imagecorruptions’
训练程序的时候回报各种缺少依赖库的消息,根据提示安装即可
2、ModuleNotFoundError: No module named 'mmcv.cnn.weight_init
报这个错误我觉得可能是MMCV版本过高,把版本降到0.5.9错误解决。很迷!
pip install mmcv==0.5.9
test
python ./tools/test.py ./configs/polarmask/4gpu/polar_768_1x_r50.py ./work_dirs/latest.pth --out=result.pkl
eval
python ./tools/coco_eval.py result.pkl ./configs/polarmask/4gpu/polar_768_1x_r50.py
参考:https://blog.csdn.net/NOSYPIPA/article/details/100761963
参考:https://blog.csdn.net/qq_36530992/article/details/104672750