Skip to content

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

@abk11

Description

@abk11

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions