在配置coco api的时候遇到了这个问题。

从GitHub下载coco源码,解压到任意文件夹。(或者创建一个工程)coco源码链接 https://github.com/cocodataset/cocoapi

在cmd窗口,cd到PythonAPI目录,执行 python setup.py install

 

可能遇见的问题:

  1. 找不到vcversall.bat,解决办法:安装Visual Studio2015。(因为python3.5的相关编译,需要“best version>=14.0”。)

  2. 找不到参数'-Wno-cpp','-Wno-unused-function',解决办法:在setup.py文件中删除相关参数

重新执行

python setup.py install

成功后,发现import pycocotools._mask报错,查了一下发现应该使用下面说的

When you run make under the PythonAPI folder, actually you run the command python setup.py build_ext --inplace, within which your default python(mostly python2) is called. So, just run the command python3 setup.py build_ext --inplace in the PythonAPI folder for python3. 

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐