Lornatang / SRGAN-PyTorch

A simple and complete implementation of super-resolution paper.
Apache License 2.0
410 stars 105 forks source link

Train with SRGAN Generator got a big size model weights #54

Closed NOON47 closed 2 years ago

NOON47 commented 2 years ago

HI,thanks for you job ! When i train SRGAN Generator model in my environment(pytorch 1.7 torchvision 0.8 ),and it work,but got a big size model weights about 18.7M.But I found your SRGAN Generator model weights Download in https://drive.google.com/drive/folders/1A6lzGeQrFMxPqJehK9s37ce-tPDj20mD which name is "SRGAN_x4-ImageNet-c71a4860.pth.tar" only got 5.98M.i found those two mode weights get the same backbone . How can i got the same size of model weights?

Another: file train_srgan.py line 51 "d_scheduler, g_scheduler = define_scheduler(discriminator, generator)" should be "d_scheduler, g_scheduler = define_scheduler(d_optimizer, g_optimizer)"?? look forward to your answer !!

Lornatang commented 2 years ago

Thank you for your attention to this work, you can get the weight you want by following

import torch
old_model = torch.load("YOUR_MODEL_PATH")  # 17.8M
new_model = old_model["state_dict"]  # 5.98M
Lornatang commented 2 years ago

This problem seems to have been resolved, so closed...