RuntimeError: Function AddmmBackward returned an invalid gradient

Viewed 11225

RuntimeError: Function AddmmBackward returned an invalid gradient at index 2 - got [100, 80] but expected shape compatible with [80, 80]

enter image description here

And my NN : enter image description here

enter image description here

1 Answers

It could be because of your neural network shape is not compatible to the previous shape.

Try changing your fc1 from nn.Linear(in_feature=80, out_feature=80) to nn.Linear(in_feature=100, out_feature=80)

Related