Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pretrained model #33

Closed
Jing25 opened this issue Nov 21, 2018 · 6 comments
Closed

pretrained model #33

Jing25 opened this issue Nov 21, 2018 · 6 comments

Comments

@Jing25
Copy link

Jing25 commented Nov 21, 2018

I'm new to this. I'm curious that when I train the model, I got G.pth and D.pth. While in the option files, e.g., test_esrgan.json, you only provide option for "pretrain_model_G", then how about model_D? What if I want to use pretrained model_D?

@Jing25
Copy link
Author

Jing25 commented Nov 21, 2018

BTW, after I trained ESRGAN, I got the latest_G and latest_D. When I do the test, do I change "pretrain_model_G", in test_esrgan.json to latest_G?

@jnjaby
Copy link
Collaborator

jnjaby commented Nov 22, 2018

For testing, you only need to generate an SR image and the score of network_D is not required.

@xinntao
Copy link
Member

xinntao commented Nov 22, 2018

Hi @Jing25,
As jnjaby said, when testing, the model_D is unnecessary. If you want to get the outputs of D, you can add another option like "pretrain_model_D", but you also need to modify the test codes in
https://github.com/xinntao/BasicSR/blob/c345d635cdf079e39dcf0279c899d1dbe852e95c/codes/models/SRRaGAN_model.py#L188-L192

When you testing, the pretrain_model_G could be any model you want to use. You could use latest_G or models in other iterations.

@Jing25
Copy link
Author

Jing25 commented Nov 23, 2018

Thank you!

@Jing25 Jing25 closed this as completed Nov 23, 2018
@ackbar03
Copy link

Hi,

why do you say we need to modify the test codes

https://github.com/xinntao/BasicSR/blob/c345d635cdf079e39dcf0279c899d1dbe852e95c/codes/models/SRRaGAN_model.py#L188-L192

? Did you highlight the wrong section by accident? I assume you mean

https://github.com/xinntao/BasicSR/blob/c345d635cdf079e39dcf0279c899d1dbe852e95c/codes/models/SRRaGAN_model.py#L234

but even then it looks fine to me?

@xinntao
Copy link
Member

xinntao commented Nov 28, 2018

Hi @ackbar03
What I mean is that if one wants to get the outputs of D during testing, he may need to modify the test codes in the def test(self): function.

We usually do not need to output D and during testing, we only need pretrain_model_G.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants