工程代码中有这么一句
from pycocotools.coco import COCO
需要我的anaconda虚拟环境下安装了pycocotools库;
step1:需要安装visualcppbuildtools full.exe
下载地址:Microsoft Visual C++ Build Tools 2015.
下载后选择默认安装方式安装下即可~
安装后在Visual C++ Build Tools文件夹下找到Visual C++ 2015 x64 Native Building Tool Command Prompt;
Step2:安装pycocotools
激活你要将这个pycocotools库安装的anaconda虚拟环境;
我这是用conda创建了个叫pytorch_gpu的环境,将pycocotools库装在这个环境下;
然后运行如下指令即可完成安装:
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
主要参考:
https://blog.csdn.net/qq_28400629/article/details/85247087
https://github.com/maycuatroi/pycocotools-window