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: t() expects a 2D tensor, but self is 3D` #6

Open
abk11 opened this issue Mar 3, 2019 · 2 comments
Open

RuntimeError: t() expects a 2D tensor, but self is 3D` #6

abk11 opened this issue Mar 3, 2019 · 2 comments

Comments

@abk11
Copy link

abk11 commented Mar 3, 2019

Hi,

Running EnvtestStock_RPG.ipynb I get the following error:
`---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
in
14 state=next_state
15 if env.pointer%64==0:
---> 16 agent.train()
17 pv,pp,pw=env.get_summary()
18 total_pv=pv.sum(axis=1)

in train(self)
73 def train(self):
74 self.optimizer.zero_grad()
---> 75 s = torch.stack(self.s_buffer).t()
76 s_next = torch.stack(self.s_next_buffer).t()
77 r = torch.stack(self.r_buffer).t()

RuntimeError: t() expects a 2D tensor, but self is 3D`

In particular, self.s_buffer is a list of 54 tensors, each of size: torch.Size([6, 36])

Do you know what might be causing it?

Thank you in advance

EDIT: my torch version is 1.0.1

@ghost
Copy link

ghost commented Mar 6, 2019

I have the same issue.

@liiklin
Copy link

liiklin commented Mar 28, 2019

try use pytorch 0.4.0?

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