python - 安装 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'
解决方案
这是一个makefile问题。只需忽略 make 之后的 makefile 就可以了。
推荐阅读
- java - 如何实现回调?
- php - PHP mysqli oop从表错误中获取数据
- compiler-construction - 如何实现数组 - llvm
- python - pandas - 用不同的 zorder 绘制线条和标记?
- javascript - SoundCloud Widget API 的 Safari 问题:暂停时触发 SEEK 事件
- python-3.x - 将基于十进制的 &#code 转换为 unicode
- oracle - Oracle 实体框架名称已被现有对象使用
- angular - Angular 订阅 observable 然后返回一个新的
- google-streetview-publish - 批量上传到 Street View Publish API 的最佳做法?
- postgresql - 这个 xpath 函数是什么意思?