Created
March 19, 2019 15:48
-
-
Save goddoe/094839a4bef98490f0e82babf6efd672 to your computer and use it in GitHub Desktop.
pytorch: save data parallel model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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