安装COCO API

仅作参考,勿喷


官方文档https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md

官方给出的方法似乎是在Linux系统下的


本人环境说明:windows10下搭建tensorflow ssd模型,tensorflow用的是cpu版本的,用了anaconda包管理器,所以tensorflow源码框架models下的object_detection依赖的库大部分已经具备了。

步骤:

1.下载cocoapi安装包,地址:https://github.com/cocodataset/cocoapi,解压缩放在tensorflow的research目录下

2.进入cocoapi/PythonAPI目录,打开setup.py文件,将第12行的 extra_compile_args=前两个参数删掉,并保存

3.进入Anaconda Prompt,在PythonAPI目录下输入如下命令:python setup.py install

4.如果在安装报错的过程中出现如下错误:

Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

则需要安装Microsoft Visual C++,在这里我用的是通过Visual Studio安装,勾选如下图的SDK,安装好之后重复上述动作即可

Vistual Studio百度网盘链接

5.验证方法:进入python,输入:import pycocotools,没有报错即可

发布了12 篇原创文章 · 获赞 22 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_41552756/article/details/104083706