Windows安装pycocotools库
最近在运行faster-rcnn.pytorch-pytorch-1.0的时候需要安装pycocotools库,遇到了一点小波折,记录下方便后续查询。
安装pycocotools库之前需要VS工具。
网上下载(https://github.com/pdollar/coco.git)解压后
通过一下命令进行到PythonAPI目录
cd coco/PythonAPI
如没有安装cython,需先安装,否则提示错误
pip install cython
python setup.py install
python setup.py build_ext --inplace
通过运行以上命令,成果解决 No module named 'pycocotools._mask ’错误。
注意:然后将安装好的Lib\site-packages\pycocotools-2.0-py3.8-win-amd64.egg\pycocotools文件夹copy到…\faster-rcnn.pytorch-pytorch-1.0\lib\pycocotools替换,运行成功。