pytorch maskrcnn-benchmark图像视频分割安装windows使用

1、当然先去 https://github.com/facebookresearch/maskrcnn-benchmark 把项目clone下来
然后安装 pip install -r requirements.txt文件

2,安装完可以测试demo下,在使用测试demo时需要在首级目录先运行下python setup.py build develop然后在测试

pytorch maskrcnn-benchmark图像视频分割安装windows使用_第1张图片

3、测试过程有很多坑需要注意,在此注意apex版本问题容易出现,这是N卡的相关软件
Class advice impossible in Python3. Use the @implementer class decorator instead,解决方法

最开始需要卸载原来的,pip uninstall apex
I uninstalled the old version of apex and reinstalled a new version. It worked. Thanks.

git clone https://www.github.com/nvidia/apex
cd apex
python setup.py install

4、还有个Microsoft visual c++ 14.0 is required问题解决办法

下载安装包安装即可:

Microsoft visual c++ 14.0
对应的是2015版本
参考下载:https://blog.csdn.net/qq_20681909/article/details/85111811
https://pan.baidu.com/s/11DFcMmuIEqz2ggpkcetF1Q

5、最终运行demo项目如下,up测试还行,就是精度识别有点。。你懂的
pytorch maskrcnn-benchmark图像视频分割安装windows使用_第2张图片

6、训练自己数据时错误解决

a、 python tools/train_net.py --config-file configs/my_cfg/e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml

ModuleNotFoundError: No module named ‘pycocotools’
这个直接pip安装会报错 cl : Command line error D8021 : invalid numeric argument ‘/Wno-cpp’
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\

解决方法:pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

b、UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xb2 in position 7: ordi

修改安装的D:\acaconda\Lib\site-packages\torch\utils的collect_env.py
 rc = p.returncode
    if PY3:
        output = output.decode("ascii")
        err = err.decode("ascii")
    return rc, output.strip(), err.strip()

我这里把ascii换成gbkwork,换成utf-8失败;如果报的utf-8失败,我换成gb2312成功

c、cuda out of 更改defaults _C.SOLVER.IMS_PER_BATCH _C.TEST.IMS_PER_BATCH值为2
d、RuntimeError: copy_if failed to synchronize: device-side assert triggered 更改defaults学习率_C.SOLVER.BASE_LR 0.0001
pytorch maskrcnn-benchmark图像视频分割安装windows使用_第3张图片

训练自己数据请看下篇:https://blog.csdn.net/weixin_42357472/article/details/93378834
pytorch maskrcnn-benchmark图像视频分割安装windows使用_第4张图片

你可能感兴趣的:(深度学习)