Pytorch踩坑實(shí)錄
>>> import torch
Traceback (most recent call last):
? File "<stdin>", line 1, in <module>
? File "C:\programming\anaconda\envs\d2l\lib\site-packages\torch\__init__.py", line 122, in <module>
? ? raise err
OSError: [WinError 127] 找不到指定的程序。 Error loading "C:\programming\anaconda\envs\d2l\lib\site-packages\torch\lib\torch_cuda_cpp.dll" or one of its dependencies.
解決上述問題:
1. CUDA版本查詢:支持的版本與Nvidia驅(qū)動(dòng)有關(guān)
nvidia-smi

????nvcc-v

2. torch環(huán)境沖突
conda uninstall pytorch
pip uninstall pytorch
pip uninstall torchvision
pip uninstall torchaudio
3. 卸載后
conda clean -a
4. 重新安裝pytorch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
5.問題解決

標(biāo)簽: