安装过程直接按照官方的步骤安装.
官方地址:https://github.com/open-mmlab/mmdetection
由于使用conda安装,所以安装成功后会在anaconda下创建mmdetection如图1,我们所需要的东西在mmcv下的mmdetection下.
图1
图2
安装成功的另一种状态
安装成功后进行测试可按照 此文章的方法
faster_rcnn_r50_fpn_1x_20181010-3d1b3351.pth 下载地址 百度网盘链接mmdetection(密码:dpyl).
报错1:RuntimeError: CUDA out of memory. Tried to allocate 120.00 MiB (GPU 0; 3.81 GiB total capacity; 2.78 GiB already allocated; 76.19 MiB free; 132.42 MiB cached)
修改bach size对应cofig里imgs_per_gpu.
报错2:urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)>导致下载不了
在代码中添加
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
参考:https://www.freesion.com/article/5564134964/
报错3:在run的时候完全正常,但debug时报错且闪退,在程序运行到from mmdet.apis.inference import init_detector, inference_detector, show_result的时候直接闪退
显示This application failed to start because it could not find or load the Qt platform plugin "xcb".
解决:我的pycharm使用的环境是在anaconda下创建的虚拟环境open-mmlab1.0 bin文件下的python
所以直接anaconda\plugins里的platforms文件夹拷贝到open-mmlab1.0下的bin文件夹里就行了,主要是需要跟用的python放在一起
参考:https://www.jianshu.com/p/c1be256d5b95?utm_source=oschina-app
报错4:如果在加载模型的时候报错:比如storage..,则重新下载一个预训练模型