I’ve a similar issue to this: Import torch file with trained model in CUDA, in a CPU machine
I’d trained a model on Colab with CUDA service, and saved as model.pickle file.
When I want to load the model on my local computer via:
with open("D:/models/resnet34_new.pickle", 'rb') as file:
model = torch.load(file, map_location=torch.device('cpu'))
It shows the error:
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.
I’d searched multiple solutions online, but none works for me.
What could I do the load the model?
Thank you for any help!