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

Some spikes in the total loss #807

Open
John1231983 opened this issue Oct 19, 2019 · 6 comments
Open

Some spikes in the total loss #807

John1231983 opened this issue Oct 19, 2019 · 6 comments

Comments

@John1231983
Copy link

John1231983 commented Oct 19, 2019

During training, I found the total loss of cycleGAN rapidly increases at some epoch as the figure. Could you tell me the technical word of the issue? How to solve it?
Screenshot from 2019-10-19 16-42-31

@John1231983 John1231983 changed the title Total loss increase at some epoch Some spikes in the total loss Oct 19, 2019
@junyanz
Copy link
Owner

junyanz commented Oct 20, 2019

Sometimes, it might be caused by an out-of-distribution training image: i.e., a usual training image that looks quite different from others. For example, most of your input has rich texture and structure, and suddenly you feed the network a flat input.

@John1231983
Copy link
Author

John1231983 commented Oct 20, 2019

You meant that sometimes the input network is noise images (i.e. many backgrounds with black regions and foreground is quite small).
You are right. I use crop image, so maybe sometimes the cropped image contains only background region with very small foreground region.

@junyanz
Copy link
Owner

junyanz commented Oct 20, 2019

If you want to inspect it, you can add some debugging code. Each time, the loss is above some threshold, you save images to the disk.

@John1231983
Copy link
Author

Great suggestion. I will let you know the region. Actually, I met the issue when I train with multiple GPU. I increase the crop-size but the issue still happens. Let I debug it

@John1231983
Copy link
Author

John1231983 commented Oct 25, 2019

@junyanz I found the issue. The issue is that the generator is too strong because I added a new loss to the generator, Hence, the D may easy to fool. Do you have any suggestion to solve it? Do I need to add more layer for D network (currently I used the patch of 7x7 as the output of the D network).

@junyanz
Copy link
Owner

junyanz commented Oct 25, 2019

You can add a few more layers, or increase the learning rate of D.

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