本身COCO的 pycocotools是不支持windows安裝的,然而,抵不過國內各路大神的操作~~~
1. 激活pytorch,先安裝bulid tools for VS2015,否則會安裝失敗,參考了https://blog.csdn.net/zgcr654321/article/details/85177874;
2. C:\Users\Administrator\Anaconda3\envs\pytorch\Lib\site-packages\pip\compat裏__init__.py文件的第75行,把utf-8改爲gbk;
3. activate pytorch, 輸入python -m pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI。
附加鏈接:https://github.com/philferriere/cocoapi