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

layer.py #18

Open
zhp66 opened this issue Jan 4, 2021 · 2 comments
Open

layer.py #18

zhp66 opened this issue Jan 4, 2021 · 2 comments

Comments

@zhp66
Copy link

zhp66 commented Jan 4, 2021

@ntubiolin @nnzhan Hello,I had the same problem
return torch._C._VariableFunctions.einsum(equation, operands) RuntimeError: size of dimension does not match previous size, operand 1, dim 1
in
MTGNN-master/layer.py", line 14, in forward x = torch.einsum('ncvl,vw->ncwl',(x,A))
and I printed out the shapes of X and A
torch.Size([64, 32, 206, 13]) torch.Size([207, 207])
I'm using the METR-LA dataset

@nnzhan
Copy link
Owner

nnzhan commented Mar 12, 2021

Can you provide the script you run the code?

@1018594417
Copy link

I met the same problem with zhp66,
as the iter came to 600 ,
Traceback (most recent call last):
File "train_single_step.py", line 220, in
val_acc, val_rae, val_corr, test_acc, test_rae, test_corr = main()
File "train_single_step.py", line 182, in main
args.batch_size)
File "train_single_step.py", line 27, in evaluate
output = model(X)
File "C:\Users\10185\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "C:\Users\10185\PycharmProjects\mt\MTGNN-master\net.py", line 121, in forward
x = self.gconv1[i](x, adp)+self.gconv2[i](x, adp.transpose(1,0))
File "C:\Users\10185\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 547, in call
result = self.forward(input, **kwargs)
File "C:\Users\10185\PycharmProjects\mt\MTGNN-master\layer.py", line 72, in forward
h = self.alpha
x + (1-self.alpha)*self.nconv(h,a)
File "C:\Users\10185\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "C:\Users\10185\PycharmProjects\mt\MTGNN-master\layer.py", line 14, in forward
x = torch.einsum('ncwl,vw->ncvl',(x,A))
File "C:\Users\10185\anaconda3\envs\pytorch\lib\site-packages\torch\functional.py", line 202, in einsum
return torch._C._VariableFunctions.einsum(equation, operands)
RuntimeError: size of dimension does not match previous size, operand 1, dim 1

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