UPSNet
UPSNet copied to clipboard
Gradient w.r.t input is NoneType
I wanted to observe the gradient w.r.t inputs (that is, the input image here).
So, I tried to print data['data'].grad after loss.backward() below.
https://github.com/uber-research/UPSNet/blob/master/upsnet/upsnet_end2end_train.py#L216
But I got an error saying that data['data'].grad is NoneType.
Is there anything I misunderstand or missed or what's the correct way to dump the gradient w.r.t inputs? Any idea would be appreciated. Thanks.
Hi, does anyone know how I can solve this issue? I tried to set data['data'].requires_grad_(True), but it didn't work. I am still stuck with this. Thanks.