I get this error upon calling .step() of a optimizer on my model after backprop:
Traceback (most recent call last):
File "gru_model_biliear.py", line 259, in <module>
optimizer.step()
File "/home/nilabhra/miniconda2/envs/pytorch/lib/python2.7/site-packages/torch/optim/adam.py", line 74, in step
p.data.addcdiv_(-step_size, exp_avg, denom)
RuntimeError: sizes do not match at /py/conda-bld/pytorch_1493676237139/work/torch/lib/THC/generated/../generic/THCTensorMathPointwise.cu:566
The final layer of the model is a nn.Bilinear layer. The error goes away if I replace it with a nn.Linear layer.
Possible bug in the backward function?
Might be a while before I can get the tensor sizes via PDB. I did check the grad sizes after back prop. The Bilinear layer weight.data was of the shape 5x5x5 while the weight.grad was of the shape 5x5. The shape of the bias and it’s gradient was consistent
I think I should open a github issue. I have seen the implementation. Not sure if the loop body is correct, will try to understand it a bit more to see if I can come up with a fix myself.