Faster R-CNN框架 ,ubuntu18.04
报错1:编译lib文件报错
1)unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
2)CompileError: command 'gcc' failed with exit status 1
3)cffi.error.VerificationError: CompileError: command ‘gcc’ failed with exit status 1
原因:gcc版本与torch版本不匹配
解决:0.4.0版本torch+5.5版本gcc
在ubuntu18.04中安装gcc5和g++5_ubuntu18.04 gcc 5-CSDN博客
conda install pytorch=0.4.0 -c pytorch
报错2:运行出现错误
RuntimeError: reciprocal is not implemented for type torch.cuda.ByteTensor
解决:使用0.3.1版本torch,0.2.0版本torchversion(根据机子cuda选择,链接如下)
使用conda/pip安装pytorch 0.3.1教程(mac/windos/linux)-CSDN博客
conda install torchvision=0.2.0
报错3:
The error message you're encountering, "ImportError: /home/welt/CIOD_0.4/lib/model/roi_align/_ext/roi_align/_roi_align.so: undefined symbol: __cudaRegisterFatBinaryEnd," suggests that there may be an issue with CUDA-related symbols in your code.
cuda版本与cuda编译版本不一致,即
与/usr/local/cuda 的版本要一致,我这里是9.0
9.0安装:选runfile,18.04系统选择17.04可行
CUDA Toolkit 9.0 Downloads | NVIDIA Developer
版本切换(软链接修改):
ubuntu18.04中cuda11.0和cuda9.0多版本安装与切换_ubuntu18 cuda多版本 apt-get-CSDN博客
报错4:段错误(核心已转储)
详细debug:
Ubuntu20.04出现段错误核心已转储问题解决方案_段错误 (核心已转储)-CSDN博客
跑了几次,突然出现具体错误:
RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.cuda.LongTensor for argument #3 'source'
鉴于我没有改代码却报错,应该是内存或者包的问题:
重装了下torch,恢复