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: matrices expected, got 1D, 2D tensors #2

Open
stiger104 opened this issue Dec 19, 2017 · 3 comments
Open

RuntimeError: matrices expected, got 1D, 2D tensors #2

stiger104 opened this issue Dec 19, 2017 · 3 comments

Comments

@stiger104
Copy link

Traceback (most recent call last):
  File "/Users/tom/PycharmProjects/PyTorch-ActorCriticRL/main.py", line 38, in <module>
    action = trainer.get_exploration_action(state)
  File "/Users/tom/PycharmProjects/PyTorch-ActorCriticRL/train.py", line 64, in get_exploration_action
    action = self.actor.forward(state).detach()
  File "/Users/tom/PycharmProjects/PyTorch-ActorCriticRL/model.py", line 94, in forward
    x = F.relu(self.fc1(state))
  File "/Library/anaconda/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/Library/anaconda/lib/python2.7/site-packages/torch/nn/modules/linear.py", line 54, in forward
    return self._backend.Linear()(input, self.weight, self.bias)
  File "/Library/anaconda/lib/python2.7/site-packages/torch/nn/_functions/linear.py", line 10, in forward
    output.addmm_(0, 1, input, weight.t())
RuntimeError: matrices expected, got 1D, 2D tensors at /Users/soumith/miniconda2/conda-bld/pytorch_1493756739997/work/torch/lib/TH/generic/THTensorMath.c:1232
@dragen1860
Copy link

Hi, have you solved the bug, @stiger104 . I came across the same problem.

@zhaoxuexuan
Copy link

The Pull requests "fix backward() error related to squeeze and another error with action… #3" works!

@SandPhoenixX517
Copy link

Hello guys, did you solve this error and if so do you remember how yoy did so

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

4 participants