Skip to content
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

error in forecasting code. #12

Open
m-jam20 opened this issue Feb 16, 2024 · 6 comments
Open

error in forecasting code. #12

m-jam20 opened this issue Feb 16, 2024 · 6 comments

Comments

@m-jam20
Copy link

m-jam20 commented Feb 16, 2024

Hi,
when I run exe_forecasting.py it gives me type error.

The type error is :
TypeError: embedding(): argument 'indices' (position 2) must be Tensor, not NoneType

It is from this part of the code:
main_model.py", line 356, in get_side_info
feature_embed = self.embed_layer(feature_id).unsqueeze(1).expand(-1,L,-1,-1)

It would be great if you fix this.

@y-tashi
Copy link
Collaborator

y-tashi commented Feb 19, 2024

Hi,

I have run the code with the sample electricity dataset and there is no problem.
If you use your original dataset, please set "target_dim" in exe_forecasting.py.

@fangger4396
Copy link

Hi,

I have the same error as follows:

TypeError: embedding(): argument 'indices' (position 2) must be Tensor, not NoneType

I use the electricity dataset here.
It seems that the feature_id here is None and the embed_layer can not accept a None as input.
I am not sure if it matches the original intent of the authors.

@StefanStanisor
Copy link

I am having the same problem, using the electricity dataset provided

@y-tashi
Copy link
Collaborator

y-tashi commented Mar 14, 2024

Hi all,

Sorry for the inconvenience.
I have understood the issue and fixed the code.

@StefanStanisor
Copy link

@y-tashi I can confirm that it is working now.

However, I am getting weird results when predicting. I get inf and all the computed losses are nan. I looked a bit in the results and they seem to blow up more and more from sample to sample.

I am running the model on 'mps' device, which is the GPU provided by apple on their Macbook Ms and I am suspecting that is where the error is coming from.

If anyone has encounterd this problem and identified any possible solutions, that would be a life saver as I am trying to write my Masters thesis and I don't have a Nvidia GPU.

I am also obtaining this type of results when predicting using TimeGrad model as well.

@StefanStanisor
Copy link

OK, so I ran it on cpu and indeed I stop getting inf and nan values. Any idea what (maybe a particular pytorch module like LayerNorm or smth) is causing mps to blow up? I am thinking I could rewrite the module and maybe than it will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants