首页 > 解决方案 > 安装 COCOAPI for python 3.5.2

问题描述

我听说原始 COCOAPI 存在 python 版本不兼容问题,并且它不适用于 python 3?所以我正在使用这个版本: https ://github.com/philferriere/cocoapi

但是我遇到了与使用原始 COCOAPI 时类似的问题。

运行后: pip install git+ https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI,我设法得到: Successly built pycocotools

当我尝试在 PythonAPI 文件夹下制作时: .../cocoapi-master/PythonAPI$ make

它返回没有任何错误: python setup.py build_ext --inplace running build_ext rm -rf build

但是,当我尝试运行时: .../cocoapi-master/PythonAPI$ python Makefile 我不断收到此错误: File "Makefile", line 1 all: ^ SyntaxError: invalid syntax

当我尝试运行时: .../cocoapi-master/PythonAPI/demos$ python pycocoDemo.ipynb 我收到此错误: Traceback (most recent call last): File "pycocoDemo.ipynb", line 7, in "collapsed": true NameError:未定义名称“true”

在此之前,我曾尝试运行和安装原始的 cocoapi(https://github.com/cocodataset/cocoapi/tree/master/PythonAPI),但它给出了类似的错误。我四处搜索并尝试安装额外的软件包,升级 pip 版本等,但都没有工作......有人可以告诉我吗?您的帮助将不胜感激!!!

Python 版本:3.5.2,Pip 版本:18.0,Cython 版本:0.28.5,pycocotools-2.0,numpy.version.version:'1.14.2'

标签: pythonmakefileinstallationpython-3.5image-segmentation

解决方案


这是一个makefile问题。只需忽略 make 之后的 makefile 就可以了。


推荐阅读