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

RuntimeError: mat1 and mat2 shapes cannot be multiplied (8x64 and 128x128) #3

Open
LongchaoDa opened this issue Jun 24, 2024 · 0 comments

Comments

@LongchaoDa
Copy link

Hi, I was running the code and happened with the following error:

ERROR: mat1 and mat2 shapes cannot be multiplied (8x64 and 128x128)

This also comes with command: python3 main.py --name airfoil --episodes 30 --steps 15

I believe it is caused by the initialization of self.eval_net, and might be some dimension issue:
image

Would you mind re-executing it and see if it has the same error from your end? (This error comes after 6 steps of successful running in the first episode, so you might want to wait for a while after running)

Detailed trackback information:

Traceback (most recent call last):
File "main.py", line 229, in
train(params)
File "main.py", line 165, in train
model_cluster1.learn(optimizer_c1)
File "/data/liliu/Vaccine_Study/pre_analysis/Feature_reconst/Group-wise-Reinforcement-Feature-Generation-for-Optimal-and-Explainable-Representation-Space-Reconst/model.py", line 303, in learn
q_eval = self.eval_net(net_input)
File "/.conda/envs/daily/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/.conda/envs/daily/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/pre_analysis/Feature_reconst/Group-wise-Reinforcement-Feature-Generation-for-Optimal-and-Explainable-Representation-Space-Reconst/model.py", line 48, in forward
x = self.fc1(x)
File "/.conda/envs/daily/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/.conda/envs/daily/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/.conda/envs/daily/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 114, in forward
return F.linear(input, self.weight, self.bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (8x64 and 128x128)

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

1 participant