在mmdetection中跑coco数据集出现错误:
self.cat_ids = self.coco.get_cat_ids(cat_names=self.CLASSES)
AttributeError: 'COCO' object has no attribute 'get_cat_ids'
1、有说:退COCO版本的:https://blog.csdn.net/jizhidexiaoming/article/details/107180495
mmdetection官方建议将coco.py回退到以前版本
git checkout 206107 – mmdet/datasets/coco.py
2、大部分说重装COCOAPI的:
pip install "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools"
但是我重装不了提示错误如下:
E: Unable to locate package git+https://gitee.com/ztdztd/cocoapi.git#subdirectory
E: Couldn't find any package by glob 'git+https://gitee.com/ztdztd/cocoapi.git#subdirectory'
E: Couldn't find any package by regex 'git+https://gitee.com/ztdztd/cocoapi.git#subdirectory'
最终解决办法来了!!!
直接在pycharm 里搜索 mmpycocotools 安装!完美解决!有用请点赞!