pytorch CUDA问题,我想GPU可能检测不到

ego6inou  于 2023-02-04  发布在  其他
关注(0)|答案(2)|浏览(367)

我尝试安装这个:https://github.com/bycloudai/CVPR2022-DaGAN-Window
并使用

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
to install torch.

有一个小问题。
当我尝试在ANACONDA(conda)中运行下一个命令时,我得到的错误:

python demo.py  --config config/vox-adv-256.yaml --driving_video driving/driving.mp4 --source_image input/input.jpg --checkpoint checkpoints/SPADE_DaGAN_vox_adv_256.pth.tar --relative --adapt_scale --kp_num 15 --generator SPADEDepthAwareGenerator

错误:

UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=None`.
warnings.warn(msg)
Traceback (most recent call last):
File "demo.py", line 165, in <module>
loaded_dict_enc = torch.load('depth/models/weights_19/encoder.pth')
File "C:\Users\Qwepy\anaconda32\envs\DaGAN\lib\site-packages\torch\serialization.py", line 789, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "C:\Users\Qwepy\anaconda32\envs\DaGAN\lib\site-packages\torch\serialization.py", line 1131, in _load
result = unpickler.load()
File "C:\Users\Qwepy\anaconda32\envs\DaGAN\lib\site-packages\torch\serialization.py", line 1101, in persistent_load
load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
File "C:\Users\Qwepy\anaconda32\envs\DaGAN\lib\site-packages\torch\serialization.py", line 1083, in load_tensor
wrap_storage=restore_location(storage, location),
File "C:\Users\Qwepy\anaconda32\envs\DaGAN\lib\site-packages\torch\serialization.py", line 215, in default_restore_location
result = fn(storage, location)
File "C:\Users\Qwepy\anaconda32\envs\DaGAN\lib\site-packages\torch\serialization.py", line 182, in _cuda_deserialize
device = validate_cuda_device(location)
File "C:\Users\Qwepy\anaconda32\envs\DaGAN\lib\site-packages\torch\serialization.py", line 166, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

我应该怎么做?我有一个版本的CUDA工具包11.3.1与RTX 2060设置。我认为有一个问题,从这个程序的设置或因为它不检测我的GPU。
我试着重新安装cuda,并将相同的版本与我用pytorch安装的版本匹配。我还重新安装了pytorch,以确保它不是cpuonly的版本。

yqlxgs2m

yqlxgs2m1#

除了在conda环境中随PyTorch沿着安装的驱动程序之外,您不需要单独安装CUDA。请检查NVIDIA的GPU驱动程序版本,以及它们是否与CUDA工具包兼容。如果不兼容,您必须相应地升级或降级它。

dtcbnfnu

dtcbnfnu2#

尝试到安装这最新版本的pytorch通过以下这https://pytorch.org/get-started/locally/

相关问题