jacquelinelala / GFN

Gated Fusion Network for Joint Image Deblurring and Super-Resolution(BMVC 2018 Oral)
http://xinyizhang.tech/bmvc2018/
141 stars 39 forks source link

Why I can not load the pretrained model and continue to train the model? #5

Closed lycutter closed 2 years ago

lycutter commented 5 years ago

When I try to load the pretrained model that you provided name 'GFN_epoch_55.pkl' and use it to continue to run train_GFN.py, I got the errors as follows:

D:\Anaconda\envs\pytorch\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'networks.GFN_4x._DeblurringMoudle' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
D:\Anaconda\envs\pytorch\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
D:\Anaconda\envs\pytorch\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'networks.GFN_4x._ResBLockDB' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
D:\Anaconda\envs\pytorch\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'torch.nn.modules.conv.ConvTranspose2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.

It seems the pretrained model is not the same as the code in GFN_4x.py. Looking forward to your reply. Thank you.

jacquelinelala commented 5 years ago

You need to move this model to the directory of 'models/', then try it once again.

On Thu, Nov 15, 2018 at 11:08 PM lycutter notifications@github.com wrote:

When I try to load the pretrained model that you provided name 'GFN_epoch_55.pkl', I got the errors as follows:

D:\Anaconda\envs\pytorch\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'networks.GFN_4x._DeblurringMoudle' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes. D:\Anaconda\envs\pytorch\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) D:\Anaconda\envs\pytorch\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'networks.GFN_4x._ResBLockDB' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) D:\Anaconda\envs\pytorch\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'torch.nn.modules.conv.ConvTranspose2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.

It seems the pretrained model is not the same as the code in GFN_4x.py. Looking forward to your reply. Thank you.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jacquelinelala/GFN/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF2sSV_6wq1UIuFSB6Q1bKRcqK4igOQks5uvYN1gaJpZM4Yf-9o .

lycutter commented 5 years ago

Thanks for your reply, I have followed your guidance, yet it still ocurred the same errors. image

jacquelinelala commented 5 years ago

The offered 'GFN_epoch_55.pkl' is the third step training intermediate result. The original saved format is models/3/GFN_epoch_55.pkl. According to our training code, we accept two formats of pkl file. If you want to continue training on the offered 'GFN_epoch_55.pkl', you should put the 'GFN_epoch_55_pkl' into a new directory models/3/, as the training code's format, and use the parser:--resume models/3/GFN_epoch_55.pkl. Due to the learning rate is extraordinary small at this stage, we suggest that you could change the learning rate to suit your requirements.

lycutter commented 5 years ago

Thanks for your help, it works now