From ee9fff6a50a628be2f2d8c98c495508527c6a803 Mon Sep 17 00:00:00 2001 From: Phil Wang Date: Tue, 19 Apr 2022 17:24:40 -0700 Subject: [PATCH] more explicit instructions when a downgrade is necessary for loading an older saved model --- lightweight_gan/lightweight_gan.py | 3 ++- lightweight_gan/version.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lightweight_gan/lightweight_gan.py b/lightweight_gan/lightweight_gan.py index 85b7d32..42b0f40 100644 --- a/lightweight_gan/lightweight_gan.py +++ b/lightweight_gan/lightweight_gan.py @@ -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: diff --git a/lightweight_gan/version.py b/lightweight_gan/version.py index 81edede..66d9d1e 100644 --- a/lightweight_gan/version.py +++ b/lightweight_gan/version.py @@ -1 +1 @@ -__version__ = '0.22.0' +__version__ = '0.22.1'