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

train_ppon.py import errors #28

Closed
sean-horton opened this issue Jan 1, 2021 · 4 comments
Closed

train_ppon.py import errors #28

sean-horton opened this issue Jan 1, 2021 · 4 comments
Assignees

Comments

@sean-horton
Copy link

I tried train_ppon.py and got an import error on

from models.modules.LPIPS import compute_dists as lpips

I tried commenting it out and the usage of lpips and there seemed to be other import errors.

I've not tried test_ppon.py, but maybe that has errors too.

@victorca25
Copy link
Owner

Thanks for trying it out! The PPON codes have not been updated to the latest changes in the repo, it's on the TODO list

@victorca25
Copy link
Owner

@sean-horton PPON training is now fully working in my local test repo, will commit it soon, after I do some more testing to check everything works fine

@sean-horton
Copy link
Author

Awesome, I look forward to trying it out. Thanks!

@victorca25
Copy link
Owner

victorca25 commented Jan 9, 2021

@sean-horton the reworked code for PPON is now up. Now you can train PPON using the normal train.py file, only need to change these options in the option file:

model: ppon
...
which_model_G: ppon
mode: CNA
nf: 64
nb: 24
in_nc: 3
out_nc: 3
group: 1
...
pixel_criterion: l1
pixel_weight: 1
feature_criterion: l1
feature_weigh": 1
ssim_type: ms-ssim
ssim_weight: 1e-2
ms_criterion: multiscale-l1
ms_weight: 1e-2
gan_type: vanilla
gan_weight: 8e-3
...
p1_losses: [pix] # from the paper: l1 pixel_weigh: 1
p2_losses: [pix-multiscale, ms-ssim] # from the paper: multiscale_weight: 1, ms-ssim_weight: 1
p3_losses: [fea] # from the paper: VGG feature_weight: 1 gan_weight: 0.005
ppon_stages: [1000, 2000] # The first value here is where phase 2 (structure) will start and the second is where phase 3 (features) starts

Note that you may need to adjust your scheduler and coordinate the ppon_stages to match, the original paper used "StepLR_Restart". The last part is used to select which losses will be used during each phase, out of those configured and the GAN is at the moment only enabled on the last phase, following the paper. You can configure any of the losses in any of the phases, I recommend testing "contextual" (cx) if possible, specially on phases 2 and 3.

@victorca25 victorca25 self-assigned this Jan 11, 2021
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

2 participants