【detectron2】detectron2在ubuntu16.04系统下安装报错问题

有问题请留言,争取持续更新。

硬件环境

1、显卡:2080Ti
2、CUDA环境:cuda10.1,cudnn7.6.3

anaconda3环境

1、python=3.6
2、opencv=3.4.2
3、pycocotools=2.0.0

问题

1、ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/home/fpi/anaconda3/envs/abcnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1400, in _run_ninja_build check=True) File "/home/fpi/anaconda3/envs/abcnet/lib/python3.6/subprocess.py", line 438, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
原因
ninja这个包在bash下查看版本:
在这里插入图片描述
解决办法
将torch的源码cpp_extension.py里面的源码的nijia版本读取的"-v"改成"–version",如下所示:
2、g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/vision.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cpu.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.o: No such file or directory g++: error: /home/fpi/Videos/ABCNet.pytorch/detectron2/build/temp.linux-x86_64-3.6/home/fpi/Videos/ABCNet.pytorch/detectron2/detectron2/layers/csrc/cuda_version.o: No such file or directory error: command 'g++' failed with exit status 1
原因
conda和pip安装的依赖项或有不同导致不能混用
解决办法
仅使用pip安装依赖项,成功了;
【detectron2】detectron2在ubuntu16.04系统下安装报错问题_第1张图片
附上pip安装教程:

http://aiuai.cn/aifarm1288.html

你可能感兴趣的:(detectron2,目标检测,深度学习,图像识别)