Skip to content

Instantly share code, notes, and snippets.

@aidiary
Last active November 27, 2019 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aidiary/a8fe81df2053ffafd59d7e523733d189 to your computer and use it in GitHub Desktop.
Save aidiary/a8fe81df2053ffafd59d7e523733d189 to your computer and use it in GitHub Desktop.
[PyTorch] GPUの重みをCPUでロード
load_weights = torch.load(load_path, map_location={'cuda:0': 'cpu'})
net.load_state_dict(load_weights)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment