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: stack expects a non-empty TensorList #2635

Closed
abdou385 opened this issue Dec 20, 2022 · 1 comment
Closed

RuntimeError: stack expects a non-empty TensorList #2635

abdou385 opened this issue Dec 20, 2022 · 1 comment

Comments

@abdou385
Copy link

first of all I thank , I tried to train model with pytorch but I got the following error: RuntimeError: stack expects a non-empty TensorList .I am trying to model a extract features point cloud using deep learning in pytorch. I get the following error . Could anyone help on this? * Thanks!

def kmeansConvThreader(modules, input_tensor):
    list1_append = []
    list2_append = []
    list3_append = []
    threads = []
    for i, t in enumerate(input_tensor):
        threads.append(
            Thread(target=kmeansAppender, args=(modules[i], t, list1_append, list2_append, list3_append, i)))
    [t.start() for t in threads]
    [t.join() for t in threads]
    list1_append.sort()
    list2_append.sort()
    list3_append.sort()
    list1_append = list(map(lambda x: x[1], list1_append))
    list2_append = list(map(lambda x: x[1], list2_append))
    list3_append = list(map(lambda x: x[1], list3_append))
    return torch.stack(list1_append), torch.stack(list2_append), torch.stack(list3_append)
File ~\Desktop\Forum\unit.py:611, in kmeansConvThreader(modules, input_tensor)
    609 list2_append = list(map(lambda x: x[1], list2_append))
    610 list3_append = list(map(lambda x: x[1], list3_append))
--> 611 return torch.stack(list1_append), torch.stack(list2_append), torch.stack(list3_append)

RuntimeError: stack expects a non-empty TensorList

Thanks for your help

@abdou385
Copy link
Author

abdou385 commented Jan 2, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants