装了好多遍,问题很多,有些错误需要重新安装才行,下面列几个典型(网上没有直接的解决办法,需要多次尝试的):
1 pytorch与torchvision的版本不匹配
首先查看pytorch与torchvision相匹配的版本,在maskrcnn-benchmark安装中,pytorch=1.0 torchviosion=0.22,
1)安装PyTorch----------------
conda install -c pytorch pytorch-nightly torchvision cudatoolkit=9.0
(install.md里面的,但是尝试之后各种报错 发现问题是pytorch torchvision的版本不匹配)
2)卸载torchvision 0.3.0,安装torchvision 0.2.2----------------
pip uninstall torchvision
pip install torchvision==0.2.2
https://www.cnblogs.com/zlian2016/p/11563736.html
2 编译 NVIDIA apex 出错解决方法
git clone https://github.com/NVIDIA/apex.git
python setup.py install --cuda_ext --cpp_ext
报错----------error: command 'gcc' failed with exit status 1
当时围绕 gcc 找了很久的解决方法,最后发现本质原因并不是 gcc, 而是要往上找具体的 error位置, 问题在csrc/mlp.cpp这里
解决方法--------------
git checkout f3a960f80244cf9e80558ab30f7f7e8cbf03c0a0
https://blog.csdn.net/mm1327/article/details/106878984
https://blog.csdn.net/qq_40081208/article/details/107034502?%3E
3 测试maskrcnn-benchmark的demo时, 报错RuntimeError: _th_cat is not implemented for type CPUBoolType
当时觉得巨难找的问题,就奇怪为啥只有我会这样报错, 后来查资料 可能是pytorch的版本问题, 1.2.0之前的版本会有这个问题
直接搜索报错语句没有结果,搜索CPUBoolType也没有结果,然后根据CPUBoolType找到CUDABoolType,根据关键词CUDABoolType找到解决方法.
解决方法--------------
一步步调试, 只要出现torch.bool就改成torch.uint8
https://zhuanlan.zhihu.com/p/59425970
https://blog.csdn.net/qq_38343151/article/details/105671912
其他自行百度即可解决....