Closed godisboy closed 7 years ago
Hi, @godisboy,
It seems that you did not initialize tmp1 and tmp2 to zero before doing torch.addcmul().
Also, I think you should use Variables mask and fg and canvas in torch.addcmul(), instead of .data. Otherwise, the gradient cannot propagate back to canvas, fgimg, fggrid and fgmask.
And, did you try the original code using our STNM implementation?
@jwyang Thanks! I know the problem. torch.addcmul() only support torch.Floattensor . So I need to write the backward pass in the implement. And I will try your code soon.
Hi I implement STNM with the official function in Pytorch(grid_sample()). But the model can't converge.