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

invalid argument #2

Closed
jiayi797 opened this issue May 30, 2018 · 4 comments
Closed

invalid argument #2

jiayi797 opened this issue May 30, 2018 · 4 comments

Comments

@jiayi797
Copy link

Hello everyone,

when I run the code in my cpu computer, I run :

python main.py --horizon 24 --data data/electricity.txt --save save/elec.pt --output_fun Linear

Then it told me:

Traceback (most recent call last):
  File "main.py", line 149, in <module>
    train_loss = train(Data, Data.train[0], Data.train[1], model, criterion, optim, args.batch_size)
  File "main.py", line 55, in train
    output = model(X);
  File "/home/jiayi/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/jiayi/LSTNet/models/LSTNet.py", line 54, in forward
    s = s.view(batch_size, self.hidC, self.pt, self.skip);
RuntimeError: invalid argument 2: size '[128 x 100 x 6 x 24]' is invalid for input with 2073600 elements at /pytorch/aten/src/TH/THStorage.c:41

It puzzled me for whole day... Anyone meet this error? could you share solution with me?

Thank you anyway.

@holyglenn
Copy link

Did you get a change to fix this issue? @jiayi797

@jiayi797
Copy link
Author

jiayi797 commented Jul 31, 2018

Unfortunately not. :( @holyglenn

@holyglenn
Copy link

holyglenn commented Jul 31, 2018 via email

@laiguokun
Copy link
Owner

@holyglenn is right. Simply converts it to Int will resolve this.

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

3 participants