安装Apex Pycocotools(填坑之路)

安装Apex(NVIDA使用)

在指定环境下输入以下代码

git clone https://www.github.com/nvidia/apex
cd apex
python setup.py install

安装Pycocotools(coco数据集使用)

在指定环境下输入以下代码

git clone https://github.com/pdollar/coco.git
cd coco/PythonAPI
python setup.py build_ext --inplace                # install pycocotools locally
python setup.py build_ext install                     # install pycocotools to the Python site-packages

运行第三句出现错误
error: [WinError 3] 系统找不到指定的路径。: ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\PlatformSDK\lib’

error: command ‘cl.exe’ failed: No such file or directory
解决方法
1)下载Microsoft Visual C++ Build Tools
链接: https://pan.baidu.com/s/1hvVt-FzPqZxD8M_a0BpNBA 提取码: i4jj
2)安装下载好的文件(如安装时显示需要卸载visual c++2015…,则需要卸载后安装)
3)运行python setup.py build_ext --inplace出现错误:
在这里插入图片描述

error: command ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe’ failed with exit status 2
解决方法,修改代码,详见:https://blog.csdn.net/qq_29592829/article/details/82877494
4)继续安装

python setup.py build_ext --inplace

安装Apex Pycocotools(填坑之路)_第1张图片

python setup.py build_ext install

安装Apex Pycocotools(填坑之路)_第2张图片
安装Apex Pycocotools(填坑之路)_第3张图片
安装Apex Pycocotools(填坑之路)_第4张图片
5)验证

from eval.cocoapi_evaluator import COCOAPIEvaluator

运行无误,则成功!

你可能感兴趣的:(pytorch,apex,pycocotools,图像识别)