Attempting to deserialize object on a CUDA device but torch.cuda.is_available()的可能原因

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.

原因可能是只有两个卡,但是制定的gpu id是4.

你可能感兴趣的:(pytorch学习,深度学习,python,pytorch,gpu,cuda)