Skip to content

Instantly share code, notes, and snippets.

@goddoe
Created March 19, 2019 15:48
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 goddoe/094839a4bef98490f0e82babf6efd672 to your computer and use it in GitHub Desktop.
Save goddoe/094839a4bef98490f0e82babf6efd672 to your computer and use it in GitHub Desktop.
pytorch: save data parallel model
try:
state_dict = model.module.state_dict()
except AttributeError:
state_dict = model.state_dict()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment