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

Loss raise to abnormal and batchsize #124

Open
Hong-yu-Zhang opened this issue Nov 9, 2022 · 5 comments
Open

Loss raise to abnormal and batchsize #124

Hong-yu-Zhang opened this issue Nov 9, 2022 · 5 comments

Comments

@Hong-yu-Zhang
Copy link

Loss raises to several million after 50 epochs (Before 50 epoch is normal). And why I can only allow batchsize 2 on RTX3090 when training, 2 more will out of memory.

@HLImg
Copy link

HLImg commented Nov 13, 2022

I have the same problem. The device I used is the RTX 3090ti.​ After 200 epochs, both the char loss and edge loss grow graduallty.

@jidongkuang
Copy link

I'm in the same situation as you. How can I solve it?

@HLImg
Copy link

HLImg commented Dec 3, 2022

我和你情况一样。我该如何解决?
clipping the gradient,

torch.nn.utils.clip_grad_norm_(self.net.parameters(), 0.01)

@jidongkuang
Copy link

Could you tell me where to put this code?

@HLImg
Copy link

HLImg commented Dec 4, 2022

Could you tell me where to put this code?

loss.backward() 
torch.nn.utils.clip_grad_norm_(model_restoration.parameters(), 0.01)
optimizer.step()

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

3 participants