RLQuant icon indicating copy to clipboard operation
RLQuant copied to clipboard

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

Open abk11 opened this issue 6 years ago • 2 comments

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

abk11 avatar Mar 03 '19 20:03 abk11

I have the same issue.

ghost avatar Mar 06 '19 11:03 ghost

try use pytorch 0.4.0?

liiklin avatar Mar 28 '19 16:03 liiklin