RuntimeError: CUDA unknown error - this may be due to an incorrectly set up environment

RuntimeError: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero.

重启了无数次,无法解决。
最后的解决办法是:重新安装相同版本的显卡驱动,这样的话CUDA和CUDNN都不用重新安装。最后这种办法成功了

你可能感兴趣的:(Linux中常见问题,pytorch,gpu)