jihunchoi / recurrent-batch-normalization-pytorch

PyTorch implementation of recurrent batch normalization
244 stars 34 forks source link

RuntimeError: the number of sizes provided must be greater or equal to the number of dimensions in the tensor at /b/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:290 #3

Closed c0nn3r closed 7 years ago

c0nn3r commented 7 years ago

Hello, I get this error when I try to replace the LSTM in the language model with the modified (but normal) version found in this repo. Do you have idea where I should look to fix it? I would love to make a PR, but really having a hard time debugging this.

The error seems to happen on this line:

mask = (time < length).float().unsqueeze(1).expand_as(h_next)
jihunchoi commented 7 years ago

Hi, I can't give you a right solution just from information you provided, however it seems that the error comes from "expand" function. I think printing sizes of time, length, and h_next and then checking if there exists mismatch would help.

jihunchoi commented 7 years ago

I close this, since it seems that this is not related to the recurrent BN implementation. Please open a new issue if you are still having the problem.