跑程序时,突然出现以上问题,这种问题一般是torch版本与cuda版本不兼容所致,解决办法:
pip uninstall torch
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.0-cp36-cp36m-linux_x86_64.whl -i https://mirrors.aliyun.com/pypi/simple/
等新的torch版本安装好后,再次运行py文件,可发现错误提示消除,程序能够正常运行了