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

Trainloss:Very high volatility in loss #13

Open
pnaclcu opened this issue Mar 30, 2023 · 8 comments
Open

Trainloss:Very high volatility in loss #13

pnaclcu opened this issue Mar 30, 2023 · 8 comments

Comments

@pnaclcu
Copy link

pnaclcu commented Mar 30, 2023

Hello, thanks for your codes. They are elegant and clear. These codes help me a lot.
I got a problem as the training loss performed very well about 0.001 at the beginning of the training.
The default end epoch is set as 10000. But the training loss will get a surprising number about "Training Loss : 325440.0592" at 2000+ epochs. I am curious. Have you ever encountered this issue before?
The training batch size is 96 with 4 GPUs with PyTorch.DDP. Since the full training data set only includes about 4000 images, 4 GPUs only need about 10 iterations to end an epoch. Do you think this is the reason?
Thanks for your codes.

@yuan5828225
Copy link

I have the same problem. Have you solved the problem?

@ElvinChan777
Copy link

I have the same problem. Have you solved the problem?

Hi bro. Have you solved the promblm?

@yuan5828225
Copy link

I have the same problem. Have you solved the problem?

Hi bro. Have you solved the promblm?

Not yet . Testing with the results of the 10,000th round shows very poor results. It is ok to use the lowest loss before the fluctuation, although the result is not good, probably due to the small size of my dataset, I am trying to adjust the parameters

@Alan-Py
Copy link

Alan-Py commented Apr 15, 2023

Hey,guys. Have you solved the promblm?

@pnaclcu
Copy link
Author

pnaclcu commented Apr 15, 2023

I have the same problem. Have you solved the problem?

Hi bro. Have you solved the promblm?

Not yet . Testing with the results of the 10,000th round shows very poor results. It is ok to use the lowest loss before the fluctuation, although the result is not good, probably due to the small size of my dataset, I am trying to adjust the parameters

Hey guys. I got the solution. Add a scheduler to control the learning rate.
E.g. scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode='min', factor=0.2, patience=50,
verbose=True, min_lr=1e-6)
scheduler.step(THE LOSS YOU DEFINED)
But the loss seems that the epoch_loss denotes the batch_loss in the driver.py. So I rewrited the loss.
gl ^^

@Alan-Py
Copy link

Alan-Py commented Apr 15, 2023

@pnaclcu Good job! Can you share your loss code?

@nhthanh0809
Copy link

Hi bros,
My loss after each epoc is nan (loss value after some batch is nan)
I checked input data (image and mask) but there are no problem with data.
Does anyone have the same problem with me?

@ChenqinWu
Copy link

we can set the parameter args.scale_lr == False to solve this problem.

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

6 participants