在进行MaskRCNN 的demo的训练的时候, import coco的时候出现dlopen “no suitable image found ”问题
起初的时候不知道是什么情况,在经过各处的查询之后终于发现了真相,主要是需要安装pycocotools,在看代码的时候,pycocotools文件夹是在里面包含的,所以没有关注,但是在guihub找到了大佬开源的windows的API,但是本人的是mac本
但是按照同样地方法同样适用

github问题链接:https://github.com/philferriere/cocoapi
问题的原因为:It happens because there is a pycocotools directory in the same folder as the notebooks. The python code being imported then is the local implementation of pycocotools, not the one installed with pip. To fix this issue, the demo notebooks have been moved to their own directory
知道原因之后,下面为解决问题的方案:
第一步:
git clone https://github.com/pdollar/coco.git
第二步:
cd coco/PythonAPI
python setup.py build_ext --inplace
第三步:
python setup.py build_ext install
经过上面三个步骤,已经安装好了pycocotools到python库了,进入python3命令行就可以直接导入了,执行下面命令不报错说明已经安装成功了
在重新运行MaskRCNN中的demo文件,运行成功
顺便欣赏一下运行的结果:

本文解决MaskRCNN demo训练中importcoco时出现的“nosuitableimagefound”问题,通过安装pycocotools并调整其在Python环境中的优先级,成功解决了这一常见错误。
2227

被折叠的 条评论
为什么被折叠?



