mmdection遇到的坑--COCO object has no attribute get_cat_ids
在配置好mmdection后,当我试着去训练一下看看效果的时候,出现了下面的问题:
AttributeError: COCO object has no attribute get_cat_ids
按照官方的解释,是因为numpy版本和pycocotools的版本冲突问题,因此我们得去降低官方建议我们去降低pycocotools的版本。而一些人给出的方法是如下方案:

意思就是可以用如下2中方法更新:
1、git checkout 206107 -- mmdet/datasets/coco.py
2、pip install -U "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools"
第一种方法我没有成功,可能是我没看懂他的意思,希望看懂的朋友给个教程。
而第二种意思就是要重装(更新)cocoAPI,应该是open-mmlab团队把pycocotools的代码给fork到自己的仓库了,因为现在pycocotools库现在没人维护,他们fork过来进行了修改(我猜的)。
但是,在进行第二种方法的时候,又遇到了如下问题:更新pycocotools需要访问外网,当你执行第二种方案时,会出现问题。
因此,我想出了第二种方案,将github上的仓库转到自己的码云,这样就完美解决了问题。

因此,我们只需要执行下面的命令就可以解决问题:
pip install "git+https://gitee.com/ztdztd/cocoapi.git#subdirectory=pycocotools"
智能推荐
AttributeError: 'str' object has no attribute 'ecode'
query = query.decode(errors='replace') 报错:AttributeError: 'str' object has no attribute 'decode' 通常情况下,根据提示打开报错的文件operations.py,将 146 行改为:query = query.ecode(errors='replace') 如果还报错:AttributeErro...
AttributeError: 'dict' object has no attribute 'iteritems'
Python3.5中:iteritems变为items 这就导致了android 源码编译不过 环境 androidN 文件 build/tools/post_process_props.py 就会在这里报错 由于usr/bin/env python 指向的是 /usr/bin/python 而 /usr/bin/python 是 /usr/bin/python3.5的软链接 所以我们需要修改/u...
NoneType object has no attribute find
当你在众多大佬哪里解决不了问题的时候来这里看看吧 'NoneType' object has no attribute 'find' 我是怎么解决的呢 客观还是仅供参考吧 回答的没有什么权威性 ‘NoneType’ object has no attribute ‘find’ 这是我的代码 是爬取的抖音网红信息 爬着爬着就出现了NoneType&rs...
tornado出现object has no attribute错误
tornado object has no attribute错误 错误描述 下午程序运行时出现了一个匪夷所思的报错,说我实例化的pm类的对象没有pm_delProject方法,反复查验好几遍,确认是没有问题的,这种情况下也只能搜一搜Google了,结果大都是python关键字冲突的,但我这里明显不是这个原因啊。 探明真相 没有无缘无故的报错,但报错信息可能是有误导性的。—&mdash...
关于 NoneType : object has no attribute shape。
然后经历了改文件名、改路径、只输入文件名等等操作,但是都不太行得通。 最后修改了路径中的““为”/",瞬间跑的通了, 结合自己的修改和观察其他人的问题,可能 这个问题的原因是找不到图片。如果出现此类错误,那么检查下能否找到图像!!...
猜你喜欢
AttributeError: ‘module‘ object has no attribute ‘imread‘
错误如上图,虽然定位在了258行,但问题的定位应该在这里: 也就是misc的使用,为什么这么说呢?因为经过了验证,复现了错误: 那这种情况的出现,一般都是版本问题,在另一个环境下测试: 没有问题,可以正确读取,那这个版本是多少呢? 内置的函数看一下,记住1.1.0 pip list 看一下报错的环境下的scipy版本: 接下来就卸载加重装: 但为什么还是有错误呢? 后来发现,切换环境的的时候,原始...
AttributeError: ‘tuple‘ object has no attribute ‘layer‘
AttributeError: 'tuple' object has no attribute 'layer' 报错显示: inbound_layers = nest.map_structure(lambda t: t._keras_history.layer, AttributeError: ‘tuple’ object has no attribute ‘l...
python基础(《Python编程从入门到实践》笔记)K
python基础语法 本笔记是对这本书的基础语法部分进行了学习: 因为本身有其他语言的编程基础,所以笔记仅仅对我自不熟悉的部分进行了记录 函数...
