RuntimeError: expected a non-empty list of Tensors

I am trying to develop a gesture recognition system using deep learning in pytorch.
I get the following error .

data = torch.cat(imgs,dim=1)
RuntimeError: expected a non-empty list of Tensors

Could anyone help on this?
Thanks!

Is imgs an empty list? Print it out with print(imgs)

Yes imgs is an empty list.

So what can be done?

What are you trying to do? What should data be?

Ran into this myself today. I guess id like it to create an empty tensor, but maybe that’s problematic. Will just do an if else I guess. Anyone got a prettier solution than

if list_of_tensors:
    t = torch.stack(list_of_tensors)
else
    t = torch.tensor([])