Skip to content

Commit

Permalink
more explicit instructions when a downgrade is necessary for loading …
Browse files Browse the repository at this point in the history
…an older saved model
  • Loading branch information
lucidrains committed Apr 20, 2022
1 parent 47b8be3 commit ee9fff6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lightweight_gan/lightweight_gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,8 @@ def load(self, num=-1, print_version=True):
try:
self.GAN.load_state_dict(load_data['GAN'])
except Exception as e:
print('unable to load save model. please try downgrading the package to the version specified by the saved model')
saved_version = load_data['version']
print('unable to load save model. please try downgrading the package to the version specified by the saved model (to do so, just run `pip install lightweight-gan=={saved_version}`')
raise e

if 'G_scaler' in load_data:
Expand Down
2 changes: 1 addition & 1 deletion lightweight_gan/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.22.0'
__version__ = '0.22.1'

0 comments on commit ee9fff6

Please sign in to comment.