-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. #532
Comments
@alevangel, do you set the device to cpu in your config file? |
@samet-akcay is set to 'auto'. This is the models/patchcore/config.yaml
|
The error rises from this line:
Where it attemps to load a model from its weights, but they where trained on GPU I guess. I solved this loading error modifying the function like that:
|
@alevangel, thanks for your suggestion. We could maybe add a fix using |
Describe the bug
Trying to do an inference on CPU, with a model trained on GPU (Colab). But I get this 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.
Where I can safely set the map_location?
To Reproduce
The text was updated successfully, but these errors were encountered: