Skip to content

Make pretrained models compitable with CPU-only instances#3

Merged
Coloquinte merged 2 commits intoColoquinte:mainfrom
txfs19260817:main
Jul 15, 2021
Merged

Make pretrained models compitable with CPU-only instances#3
Coloquinte merged 2 commits intoColoquinte:mainfrom
txfs19260817:main

Conversation

@txfs19260817
Copy link
Contributor

Set pretrained=True in a CPU-only environment will cause an exception:

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.

Copy link
Owner

@Coloquinte Coloquinte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good! Thanks for the fix

@Coloquinte Coloquinte merged commit 1345907 into Coloquinte:main Jul 15, 2021
@Coloquinte
Copy link
Owner

Pushed. Thank you for catching this and writing the code :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants