Stereo R-CNN1.0:
代码克隆到自己电脑上的一些问题,只记录了从python setup.py build develop 之后出现的问题。之前的问题忘记记录了
问题
问题1:4 errors detected in the compilation of "C:/Users/none_/AppData/Local/Temp/tmpxft_00002310_00000000-10_ROIAlign_cuda.cpp1.ii". error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\bin\\nvcc.exe' failed with exit status 1
具体为什么不清楚,没有注意看,edited CUDA files to avoid Windows 10 build errors
解决方法:看这个edited CUDA files to avoid Windows 10 build errors,修改erroe提示的文件(防止以后找不到贴图)
问题2:cpp_extension.py:189: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
在 cpp_extension.py:184: UserWarning: Error checks compiler version for cl: [WinError 2] 系统找不到指定的文件。 warnings.warn('Error checks compiler version for {}: {}'.format(compiler, error ))
问题中,下载Microsoft Visual C++并因为后续??问题修改vs15为17之后,当它成功过了python setup.py build develop之后,运行demo.py出现Stereo-RCNN\lib\model\roi_layers\nms.py", line 3, in from model import _C ImportError: cannot import name '_C'
解决方法:其实第二步没有build好,重新运行python setup.py build develop,中间如果有UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到
那么以下解决方法可用,反之也许可用?找不到cl.exe;以及后续编码问题可以看这个Pytorch编译maskRCNN问题:cpp_extension.py:189: UserWarning: Error checking compiler version for cl…有具体的问题原因和解决(防止以后找不到贴图)
call cl.exe; 路径在下载的vs里找
方便复制
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
编码问题;cpp_extension.py文件路径在报错里找得到。
方便复制
#match = re.search(r'(\d+)\.(\d+)\.(\d+)', compiler_info.decode().strip())
match = re.search(r'(\d+)\.(\d+)\.(\d+)', compiler_info.decode(' gbk').strip())
demo.py
问题:im_left_data.data.resize_(img_left.size()).copy_(img_left) RuntimeError: set_sizes_contiguous is not allowed on a Tensor created from .data or .detach().
描述:在加载模型之后
load checkpoint models_stereo/stereo_rcnn_12_6477.pth
load model successfully!
解决:按提示删除data.
# im_left_data.data.resize_(img_left.size()).copy_(img_left)
# im_right_data.data.resize_(img_right.size()).copy_(img_right)
# im_info.data.resize_(info.size()).copy_(info)
im_left_data.resize_(img_left.size()).copy_(img_left)
im_right_data.resize_(img_right.size()).copy_(img_right)
im_info.resize_(info.size()).copy_(info)