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: Expected object of scalar type Long but got scalar type Float for argument #3 'index' in call to _th_scatter_add_ #44

Open
5672004gmpc3 opened this issue Mar 21, 2022 · 1 comment

Comments

@5672004gmpc3
Copy link

================
lr: 0.01
num_features: 89
hidden_dim: 32
num_gc_layers: 3

Traceback (most recent call last):
File "gsimclr.py", line 188, in
emb, y = model.encoder.get_embeddings(dataloader_eval)
File "/home/m10915046/GraphCL/unsupervised_TU/gin.py", line 76, in get_embeddings
x, _ = self.forward(x, edge_index, batch)
File "/home/m10915046/GraphCL/unsupervised_TU/gin.py", line 58, in forward
xpool = [global_add_pool(x, batch) for x in xs]
File "/home/m10915046/GraphCL/unsupervised_TU/gin.py", line 58, in
xpool = [global_add_pool(x, batch) for x in xs]
File "/home/m10915046/anaconda3/envs/graphcl2/lib/python3.6/site-packages/torch_geometric/nn/glob/glob.py", line 26, in global_add_pool
return scatter(x, batch, dim=0, dim_size=size, reduce='add')
File "/home/m10915046/anaconda3/envs/graphcl2/lib/python3.6/site-packages/torch_scatter/scatter.py", line 154, in scatter
return scatter_sum(src, index, dim, out, dim_size)
RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #3 'index' in call to th_scatter_add
The above operation failed in interpreter.
Traceback (most recent call last):
File "/home/m10915046/anaconda3/envs/graphcl2/lib/python3.6/site-packages/torch_scatter/scatter.py", line 27
size[dim] = int(index.max()) + 1
out = torch.zeros(size, dtype=src.dtype, device=src.device)
return out.scatter_add_(dim, index, src)
~~~~~~~~~~~~~~~~ <--- HERE
else:
return out.scatter_add_(dim, index, src)

@yyou1996
Copy link
Collaborator

Hi @5672004gmpc3,

Please double-check for the dependencies (https://github.com/Shen-Lab/GraphCL/tree/master/unsupervised_TU#dependencies), make sure the versions are corrected as recommended.

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

No branches or pull requests

2 participants