Shen-Lab / GraphCL

[NeurIPS 2020] "Graph Contrastive Learning with Augmentations" by Yuning You, Tianlong Chen, Yongduo Sui, Ting Chen, Zhangyang Wang, Yang Shen
MIT License
547 stars 103 forks source link

Bug report #11

Closed DLwbm123 closed 3 years ago

DLwbm123 commented 3 years ago

Hi! Thanks for sharing the code. The data loader raises an AttributeError when I run the code in unsupervised_TU. It seems that the data in the Batch is a tuple (data and data_aug):

(Data(edge_attr=[38, 4], edge_index=[2, 54], x=[17, 7], y=[1]), Data(edge_attr=[38, 4], edge_index=[2, 54], x=[17, 1], y=[1])) But in the source code of torch geometric, the data is used as "keys = [set(data.keys) for data in data_list]". This raises the error:

AttributeError: 'tuple' object has no attribute 'keys'.

Could you please help me with this bug? The version of my torch geometric is 1.3.2. Thanks!

yyou1996 commented 3 years ago

Hi @DLwbm123,

Thank you for your interest. Would you mind trying torch_geometric>=1.5.0? I think unsupervised_TU needs a higher version of it.

DLwbm123 commented 3 years ago

Thanks! It works now.