UPSNet icon indicating copy to clipboard operation
UPSNet copied to clipboard

Gradient w.r.t input is NoneType

Open WenFuLee opened this issue 6 years ago • 1 comments

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.

WenFuLee avatar Apr 20 '19 03:04 WenFuLee

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.

WenFuLee avatar Apr 25 '19 04:04 WenFuLee