pytorch-CortexNet icon indicating copy to clipboard operation
pytorch-CortexNet copied to clipboard

TypeError: expected Variable as element 1 in argument 0, but got tuple

Open kimna4 opened this issue 5 years ago • 1 comments

Hello,

"TypeError: expected Variable as element 1 in argument 0, but got tuple" Error message is printed at x = torch.cat((x, s), 1) in Model02.py

I modified some codes following the closed issues.

I tried to debug and fix. But I can't. Do you know what is the problem? Thank you

kimna4 avatar Mar 09 '19 08:03 kimna4

You may need to update your PyTorch?

>>> a = torch.tensor([[1., 2.]], requires_grad=True)
>>> b = torch.tensor([[3., 4.]], requires_grad=True)
>>> torch.cat((a, b), 1)
tensor([[1., 2., 3., 4.]], grad_fn=<CatBackward>)

For me it works just fine.

Atcold avatar Mar 11 '19 19:03 Atcold