-
Notifications
You must be signed in to change notification settings - Fork 193
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
about deblur trainning #117
Comments
I also encounter the same problem. I want to ask you how to solve this problem in the end |
I also encounter the same problem. I want to ask you how to solve this problem in the end |
你好,我发现是warmup_scheduler的问题,你可以试试删去它或者调大max epoch
…------------------ Original message ------------------
From: "KKKLeouee";
Sendtime: Wednesday, Jul 20, 2022 2:05 PM
To: "swz30/MPRNet";
Cc: "薛文 ***@***.***>; "Author";
Subject: Re: [swz30/MPRNet] about deblur trainning (Issue #117)
我也遇到了同样的问题。我想问你这个到底怎么解决的问题
1212121212
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This might help #91 (comment) |
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. |
请问你解决了吗?我也遇到了这个问题 |
loss_char = sum([criterion_char(restored[j],target) for j in range(len(restored))]) 将 np.sum改为sum就可以了 |
请问大家训练过程中遇到了损失函数突然很大的情况吗?我训练到20轮的时候损失函数就爆炸了 |
老哥问题解决了吗 |
|
现在怎么样了? |
没解决哈哈哈哈,我没有研究这个算法了 |
hello, I degraded the image in FFHQ and want to use the debur process in MPRnet to restore it.
But, when I train the model, I first met this problem
Traceback (most recent call last):
File "/home/ma-user/work/MPRnet/train.py", line 120, in
loss_char = np.sum([criterion_char(restored[j],target) for j in range(len(restored))])
File "<array_function internals>", line 6, in sum
File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 2260, in sum
initial=initial, where=where)
File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 86, in wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/torch/tensor.py", line 621, in array
return self.numpy()
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
So I changed the loss function to this
loss_char = torch.tensor([criterion_char(restored[j],target) for j in range(len(restored))]).sum()
loss_edge = torch.tensor([criterion_edge(restored[j],target) for j in range(len(restored))]).sum()
loss = ((loss_char) + (0.05*loss_edge)).requires_grad(True)
this seems work, but after trainning, I found that the PSNR is always 12.4697 and never change, the model learnd nothing from the data.
How can I do?
The text was updated successfully, but these errors were encountered: