【发布时间】:2020-05-15 18:43:11
【问题描述】:
我试图在https://pytorch.org/hub/nvidia_deeplearningexamples_tacotron2/下载以下模型
import torch
tacotron2 = torch.hub.load('nvidia/DeepLearningExamples:torchhub', 'nvidia_tacotron2')
我收到了:
>>> import torch
>>> tacotron2 = torch.hub.load('nvidia/DeepLearningExamples:torchhub', 'nvidia_tacotron2')
Using cache found in .cache\torch\hub\nvidia_DeepLearningExamples_torchhub
...
File "Anaconda3\envs\env3_pytorch\lib\site-packages\torch\serialization.py", line 79, 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='cpu' to map your storages to the CPU.
所以我将以下内容与map_location='cpu' 一起使用,但仍然得到相同的错误。
>>> tacotron2 = torch.hub.load('nvidia/DeepLearningExamples:torchhub', 'nvidia_tacotron2', map_location='cpu')
torch.version.cuda 显示一个版本,但 torch.cuda.is_available() 为假。
>>> import torch
>>> torch.version.cuda
'9.0'
>>> torch.cuda.is_available()
False
当我使用了要求使用的命令错误消息时,如何解决与
map_location相关的错误?如何使用 cuda 加载模型?
【问题讨论】:
标签: neural-network pytorch conda