Skip to content

Update LSTNet.py#9

Open
BernardOng wants to merge 1 commit intolaiguokun:masterfrom
BernardOng:patch-2
Open

Update LSTNet.py#9
BernardOng wants to merge 1 commit intolaiguokun:masterfrom
BernardOng:patch-2

Conversation

@BernardOng
Copy link

Resolves a Runtime error occurring based on this:

Traceback (most recent call last):
File "main.py", line 149, in
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 "D:\Anaconda2\envs\py3\lib\site-packages\torch\nn\modules\module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "D:\Python\multivariate-time-series-data\models\LSTNet.py", line 53, 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 ..\src\TH\THStorage.c:41

Resolves a Runtime error occurring based on this:

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 "D:\Anaconda2\envs\py3\lib\site-packages\torch\nn\modules\module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "D:\Python\multivariate-time-series-data\models\LSTNet.py", line 53, 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 ..\src\TH\THStorage.c:41
@GuilinF
Copy link

GuilinF commented Nov 3, 2019

i have the same question. How to solve this?

@BernardOng
Copy link
Author

i have the same question. How to solve this?
Review my commit proposal.
i.e. enclose line 16 with the int( ) function.

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

Successfully merging this pull request may close these issues.

2 participants