解决AssertionError: Torch not compiled with CUDA enabled问题
有可能是Pytorch的版本不支持CUDA 11.4,重新安装Pytorch
命令如下:
1.
pip3 install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio===0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
其中,1的速度尽快,2的安装不够友好(不知为啥网速太慢)。
灵感来源:https://blog.csdn.net/alan1ly/article/details/118513100
当遇到Torch错误提示'Torch not compiled with CUDA enabled'时,可能是因为Pytorch版本不支持CUDA11.4。解决方案是重新安装特定版本的Pytorch,如1.10.0+cu113,可使用提供的pip3命令进行安装。该方法中提供了两种安装方式,一种速度较快,另一种可能因网络问题导致安装缓慢。参考链接提供了详细信息。

8万+

被折叠的 条评论
为什么被折叠?



