ZhouYuxuanYX / BlockGCN

This is the official implementation of our CVPR 2024 paper "BlockGCN: Redefine Topology Awareness for Skeleton-Based Action Recognition"
Apache License 2.0
66 stars 10 forks source link

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument tensors in method wrapper_cat) #5

Closed 223d closed 4 months ago

223d commented 5 months ago

Hi,I have a question here,Can you help me take a look? Traceback (most recent call last): File "/home/zlq/pycharm-professional-2023.1.3/pycharm-2023.1.3/plugins/python/helpers/pydev/pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/home/zlq/pycharm-professional-2023.1.3/pycharm-2023.1.3/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/zlq/project/BlockGCN-main/main.py", line 796, in processor.start() File "/home/zlq/project/BlockGCN-main/main.py", line 726, in start self.train(epoch, save_model=save_model) File "/home/zlq/project/BlockGCN-main/main.py", line 504, in train output, z = self.model(data, F.one_hot(label, num_classes=self.model.num_class), joint) File "/home/zlq/miniconda3/envs/Block/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, kwargs) File "/home/zlq/project/BlockGCN-main/model/BlockGCN.py", line 401, in forward a = self.topo(a).to(device) File "/home/zlq/miniconda3/envs/Block/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "/home/zlq/project/BlockGCN-main/model/BlockGCN.py", line 342, in forward x = self.pl(x) File "/home/zlq/miniconda3/envs/Block/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, kwargs) File "/home/zlq/miniconda3/envs/Block/lib/python3.9/site-packages/torch_topological/nn/layers.py", line 39, in forward centres = torch.cat((centres, 2 * batch[..., -1].unsqueeze(-1)), 2) RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument tensors in method wrapper_cat)

ZhouYuxuanYX commented 4 months ago

Hi,

sorry for the late reply. After the recent update, this issue should be resolved. Such an issue occurs simply because some of the tensors are not put on GPU during computation.