OSError: [WinError 126] 找不到指定的模块。 Error loading “caffe2_nvrtc.dll“ or one of its dependencies.

jupyter notebook中运行import torch,显示如下错误:

OSError: [WinError 126] 找不到指定的模块。 Error loading "C:ProgramDataAnaconda3libsite-packagestorchlibcaffe2_nvrtc.dll" or one of its dependencies.

网上说是pytorch版本问题,原来安装的是GPU版本,改为CPU版本后正常,

conda install pytorch torchvision cpuonly -c pytorch

GPU版本如何排除错误还有待研究,就先用着CPU版本。