2

When I try to load a pytorch checkpoint:

checkpoint = torch.load(pathname) 

I see:

RuntimeError: cuda runtime error (35) : CUDA driver version is insufficient for CUDA runtime version at torch/csrc/cuda/Module.cpp:51

I created the checkpoint with a GPU available, but now only have CPU available.

How do I load the checkpoint?

2 Answers 2

8

Load the checkpoint data to the best currently available location:

if torch.cuda.is_available(): map_location=lambda storage, loc: storage.cuda() else: map_location='cpu' checkpoint = torch.load(pathname, map_location=map_location) 
Sign up to request clarification or add additional context in comments.

Comments

0

1. You can run your code with CPU: I prefer setting the device = "cuda" to device = "cpu". Its works for me.

2. Reinstall PyTorch with Correct CUDA Version: pip install torch==<pytorch_version>+cu<cuda_version> -f https://download.pytorch.org/whl/torch_stable.html

Now you can use CUDA i.e. device = "cuda".

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.