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 #1

Open
redhat12345 opened this issue Jan 5, 2018 · 3 comments
Open

Error #1

redhat12345 opened this issue Jan 5, 2018 · 3 comments

Comments

@redhat12345
Copy link

redhat12345 commented Jan 5, 2018

Hi! Thank you for your code. I got the error when I run your code. Can you help please to sort out the problem?
Traceback (most recent call last):
File "main.py", line 220, in
output = net(data)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "main.py", line 71, in forward
return self.net(input)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/container.py", line 67, in forward
input = module(input)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "main.py", line 120, in forward
u_hat = torch.matmul(torch.cat([self.W] * self.batch_size, 0) , input)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/functional.py", line 214, in matmul
expand_batch_portion = torch._C._infer_size(tensor1_exp_size[:-2], tensor2_exp_size[:-2])
RuntimeError: The size of tensor a (50) must match the size of tensor b (100) at non-singleton dimension 0.

@dragen1860
Copy link
Owner

Hi, I have tried my source code for your error.
Just delete mdl file. Since the mdl file is generated by older version of pytorch and it can n't be used by newer pytorch. Delete it and re-train the total model.

@dragen1860
Copy link
Owner

pls git clone again since I update some trivial details.

@redhat12345
Copy link
Author

Thank you so much. It's working now.

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

2 participants