安装SSD-Pytorch时报错gcc: error: pycocotools/_mask.c: No such file or directory

安装SSD-Pytorch 编译cocoapi/PythonAPI时报错gcc: error: pycocotools/_mask.c: No such file or directory,报错原因是未安装cython包。

SSD-pytorch版本代码如下:https://github.com/lufficc/SSD

安装pytorch版本SSD,编译cocoapi/PythonAPI 时报错:

(py3_pytorch) xx@ubun:~/cocoapi/PythonAPI$ python setup.py build_ext install
running build_ext
building 'pycocotools._mask' extension
gcc -pthread -B /home/xx/anaconda2/envs/py3_pytorch/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/xx/anaconda2/envs/py3_pytorch/lib/python3.6/site-packages/numpy/core/include -I../common -I/home/xx/anaconda2/envs/py3_pytorch/include/python3.6m -c ../common/maskApi.c -o build/temp.linux-x86_64-3.6/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
../common/maskApi.c: In function ‘rleToBbox’:
../common/maskApi.c:141:31: warning: ‘xp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       if(j%2==0) xp=x; else if(xp<x) { ys=0; ye=h-1; }
                               ^
gcc -pthread -B /home/xx/anaconda2/envs/py3_pytorch/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/xx/anaconda2/envs/py3_pytorch/lib/python3.6/site-packages/numpy/core/include -I../common -I/home/xx/anaconda2/envs/py3_pytorch/include/python3.6m -c pycocotools/_mask.c -o build/temp.linux-x86_64-3.6/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
gcc: error: pycocotools/_mask.c: No such file or directory
error: command 'gcc' failed with exit status 1

解决方法:

conda install cython

给TA买糖
共{{data.count}}人
人已赞赏
文章目标检测

Docker构造基于centos的caffe与caffe-ssd的Dockerfile记录

2018-11-19 20:34:56

文章

关于pytorch中torch.nn.MaxPool2d 、torch.nn.AvgPool2d等函数参数记录说明

2019-1-23 17:36:29

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
搜索