You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Thank you for sharing the code. I am trying to run the experimentation on Google Colab. But I keep running into a problem when I am trying to train or test the model.
Could you please help me understand what is the source of this problem because I am having difficulty understanding it.
Basically, Colab gives me the following error:
`ValueError Traceback (most recent call last)
in <cell line: 5>()
5 with torch.no_grad():
6 for i, sample in enumerate(tqdm.tqdm(test_loader, desc="Visualising")):
----> 7 prediction = model.to(device)(sample.to(device)) ## Don't understand this line
8 # target = sample.y.clone()
9 # print('\n')
6 frames
/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _call_impl(self, *args, **kwargs)
1499 or _global_backward_pre_hooks or _global_backward_hooks
1500 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1501 return forward_call(*args, **kwargs)
1502 # Do not call functions when jit is used
1503 full_backward_hooks, non_full_backward_hooks = [], []
in forward(self, data)
95 # Downstream
96 copy0 = x.clone()
---> 97 x = self.pool1(x, data)
98 x = self.conv11(x, *scale_attr[1])
99 x = self.conv12(x, *scale_attr[1])
/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _call_impl(self, *args, **kwargs)
1499 or _global_backward_pre_hooks or _global_backward_hooks
1500 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1501 return forward_call(*args, **kwargs)
1502 # Do not call functions when jit is used
1503 full_backward_hooks, non_full_backward_hooks = [], []
Is the problem related to how the dataset is being transformed under the "pre-computed graph transform" set up and how the datasets are being transformed and loaded?
The ValueError shown above is with respect to the first dimension, in this case the dimension 0 value 24269.
Hi! It might be that the version of PyG that Google colab is using is incompatible with gem_cnn(see here). Could you try resetting PyG to version 2.0.3?
Hi,
Thank you for sharing the code. I am trying to run the experimentation on Google Colab. But I keep running into a problem when I am trying to train or test the model.
Could you please help me understand what is the source of this problem because I am having difficulty understanding it.
Basically, Colab gives me the following error:
`ValueError Traceback (most recent call last)
in <cell line: 5>()
5 with torch.no_grad():
6 for i, sample in enumerate(tqdm.tqdm(test_loader, desc="Visualising")):
----> 7 prediction = model.to(device)(sample.to(device)) ## Don't understand this line
8 # target = sample.y.clone()
9 # print('\n')
6 frames
/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _call_impl(self, *args, **kwargs)
1499 or _global_backward_pre_hooks or _global_backward_hooks
1500 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1501 return forward_call(*args, **kwargs)
1502 # Do not call functions when jit is used
1503 full_backward_hooks, non_full_backward_hooks = [], []
in forward(self, data)
95 # Downstream
96 copy0 = x.clone()
---> 97 x = self.pool1(x, data)
98 x = self.conv11(x, *scale_attr[1])
99 x = self.conv12(x, *scale_attr[1])
/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in _call_impl(self, *args, **kwargs)
1499 or _global_backward_pre_hooks or _global_backward_hooks
1500 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1501 return forward_call(*args, **kwargs)
1502 # Do not call functions when jit is used
1503 full_backward_hooks, non_full_backward_hooks = [], []
/usr/local/lib/python3.10/dist-packages/gem_cnn/nn/pool.py in forward(self, x, data)
44 size = (num_fine, num_coarse)
45
---> 46 out = self.propagate(edge_index=edge_index, x=x, connection=connection, size=size)
47 return out
48
/usr/local/lib/python3.10/dist-packages/torch_geometric/nn/conv/message_passing.py in propagate(self, edge_index, size, **kwargs)
457 kwargs[arg] = decomp_kwargs[arg][i]
458
--> 459 coll_dict = self._collect(self._user_args, edge_index, size,
460 kwargs)
461
/usr/local/lib/python3.10/dist-packages/torch_geometric/nn/conv/message_passing.py in _collect(self, args, edge_index, size, kwargs)
333
334 if isinstance(data, Tensor):
--> 335 self._set_size(size, dim, data)
336 data = self._lift(data, edge_index, dim)
337
/usr/local/lib/python3.10/dist-packages/torch_geometric/nn/conv/message_passing.py in _set_size(self, size, dim, src)
243 size[dim] = src.size(self.node_dim)
244 elif the_size != src.size(self.node_dim):
--> 245 raise ValueError(
246 (f'Encountered tensor with size {src.size(self.node_dim)} in '
247 f'dimension {self.node_dim}, but expected size {the_size}.'))
ValueError: Encountered tensor with size 24269 in dimension 0, but expected size 9708.`
The text was updated successfully, but these errors were encountered: