-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report: Error encountered when the covariates' size is different in N-Hits #1071
Comments
I also encountered this bug, and made a branch fixing it with the exact same code here before seeing this issue!: https://github.com/bendavidsteel/pytorch-forecasting/tree/weight-size-bug-fix Hope one of our solutions can get merged! |
It seems this problem still persists, can either one of you @zhangguangxun @bendavidsteel opens a pull request or propose your patch as a solution. |
@bendavidsteel it seems your fix is not merged yet, do you have any ETA on this? I cannot install the package from your branch (I can do it from master but from your branch, for whatever reason seems to have dependency problem with Pytorch lightening, any suggestion on how to use this while this problem is getting resolved?) |
That's entirely up to @jdb78 at this point! I just merged recent master updates into my branch though, and saw there was an update to |
The fix just got merged @manitadayon , so this bug can be closed @jdb78 |
Abstract
As #1065 issus metioned, N-HiTS encounters a RuntimeError when using 'time_varying_unknown_reals' and 'time_varying_known_reals' covariates simultaneously. The reason of that error is becasue the dimension of the full-connected network is mismatched during the network define process and tensor forward process.
Error Location In Source Code
In
pytorch_forecasting.models.nhits.sub_modules.py
From line 124 to line 128, The Linear layers' dimension is defined byThe
covariate_size
is input and is defined inpytorch_forecasting.models.nhits.__init__.py
From line 200 to line 208From the defination of variable
self.covariate_size
we can figure out the defination is only consider the size of categoricals variables in encoder and the size of reals variables in decoder.Howerer during the forward process, the dimension of input tensor is defined in
pytorch_forecasting.models.nhits.sub_modules.py
From line 163 to line 181When the dimension of covariates is different between encoder and decoder, Whether categoricals variables or reals variables, it will encounter a dimension mismatched error as #1065 showen.
Fixed Code
The fixed code is in linked https://github.com/zhangguangxun/nhits which defines encoder_covariate_size and decoder_covariate_size in
__init__.py
and pass them tosub_modules.py
to make sure the dimension is matched.The text was updated successfully, but these errors were encountered: