其他分享
首页 > 其他分享> > faster-cnn在pytorch上實現(零)一些小問題

faster-cnn在pytorch上實現(零)一些小問題

作者:互联网

一些安裝前的問題

1.插件問題

undefined symbol: _Py_ZeroStruct

没有对eavs进行编译
进入faster_rcnn的setup.py文件所在目录,执行下面命令进行编译:

python3 setup.py build_ext --inplace

2.版本問題

現在pytorch的版本大多數爲1.0,但git上的版本多爲0.4.1的版本,所以會出現

torch.utils.ffi is deprecated. Please use cpp extensions instead.

把版本降下去就可以解決

pip安装

pip install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp27-cp27mu-linux_x86_64.whl
pip install torchvision
#if the above command does not work, then you have python 2.7 UCS2, use this command 	
pip install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp27-cp27m-linux_x86_64.whl
2.CUDA8.0  python3.5
pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp35-cp35m-linux_x86_64.whl
pip3 install torchvision
3.CUDA8.0  python3.6
pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
pip3 install torchvision
4.CUDA8.0  python3.7
pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.1.post2-cp37-cp37m-linux_x86_64.whl
pip3 install torchvision

1.CUDA9.0  python2.7
pip install torch torchvision
2.CUDA9.0  python3.5/3.6/3.7
pip3 install torch torchvision

1.CUDA9.2  python2.7
pip install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp27-cp27mu-linux_x86_64.whl
pip install torchvision
# if the above command does not work, then you have python 2.7 UCS2, use this command
pip install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp27-cp27m-linux_x86_64.whl
2.CUDA9.2  python3.5
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp35-cp35m-linux_x86_64.whl
pip3 install torchvision
3.CUDA9.2  python3.6
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
pip3 install torchvision
4.CUDA9.2  python3.7
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1.post2-cp37-cp37m-linux_x86_64.whl

再編譯就沒有之前的問題了。

标签:問題,faster,pip3,whl,torch,0.4,實現,pytorch,install
来源: https://blog.csdn.net/Jack_and_monkey/article/details/86649274