Closed emiled16 closed 2 years ago
Hey, I am also facing the same issue.
I found my error. I had the variable time_idx twice in the the list time_varying_known_reals
. You may also have a similar problem. I suggest removing all covariates and adding them back one by one while verifying that you have no bugs. Hope this helps
Expected behavior
I am training a deepAR model but when I run the
fit
method, I expect the trainer module to do the training without encountering any errorActual behavior
However, I get the following error
RuntimeError: input.size(-1) must be equal to input_size. Expected 37, got 38
After further investigation, I realize that if
x_cont = x['encoder_cont']
wherex,y = next(iter(train_dataloader))
,x_cont.shape[-1]
is different fromlen(deepAR.reals)
.I don't understand why this is happening, especially that I am instantiating the deepAR model using
.from_dataset()
method. This should make sure that the shapes are similar, but it is not the case.Code to reproduce the problem
Above are some parts of the code, I sed the same method to initialize the validation dataloader. Moreover, here is a link to the colab if it can help: https://colab.research.google.com/drive/1SCHTGg4JpbCBpINgS1LFXPRxVDV0GVoh?usp=sharing
Finally, here's the traceback: