swz30 / MPRNet

[CVPR 2021] Multi-Stage Progressive Image Restoration. SOTA results for Image deblurring, deraining, and denoising.
Other
1.16k stars 189 forks source link

Why is the loss so big in the training? #51

Closed kzq666666 closed 3 years ago

kzq666666 commented 3 years ago

Deblurring task

The configuration I changed is as follows: BATCH_SIZE: 16 TRAIN_PS: 64 VAL_PS: 64 why is the training loss so big as the epoch is 140? image

adityac8 commented 3 years ago

Hi

You can try using gradient clipping

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

Thanks

FrankLinxzx commented 3 years ago

Hi

You can try using gradient clipping

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

Thanks

image

i meet this error too where to add this code? thx

adityac8 commented 3 years ago

Hi @FrankLinxzx

You can add these lines here. https://github.com/swz30/MPRNet/blob/435f483b6433a6cf8d43f4df9c20eebba47587bb/Deblurring/train.py#L124

Thanks

FrankLinxzx commented 3 years ago

Hi @FrankLinxzx

You can add these lines here. https://github.com/swz30/MPRNet/blob/435f483b6433a6cf8d43f4df9c20eebba47587bb/Deblurring/train.py#L124

Thanks

so much thx

bathcenter commented 2 years ago

去模糊任务

我改的配置如下: BATCH_SIZE: 16 TRAIN_PS: 64 VAL_PS: 64 为什么epoch是140,训练损失这么大? 图片 Hello. TRAIN PS: 64 VAL PS: 64, I know

TRAIN PS is the input picture size, Val PS does PS mean,

adityac8 commented 2 years ago

Hi @bathcenter

Could you add gradient clipping and see if it is resolved.

Thanks