BangHonor / SimGC

Simple Graph Condensation
8 stars 2 forks source link

TypeError: propagate() missing 1 required positional argument: 'edge_weight' #2

Closed uuice11 closed 1 month ago

uuice11 commented 2 months ago

您好,请问这里是不是缺少边的权重

alignment

concat_feat=feat_train.to(device)
temp=feat
for i in range(args.nlayers):
    aggr=validation_model.convs[0].propagate(adj.to(device), x=temp.to(device)).detach()
    concat_feat=torch.cat((concat_feat,aggr[idx_train]),dim=1)
    temp=aggr

File "SimGC_transductive.py", line 194, in train_syn aggr=validation_model.convs[0].propagate(adj.to(device), x=temp.to(device)).detach() TypeError: propagate() missing 1 required positional argument: 'edge_weight'

BangHonor commented 2 months ago

哈喽,这里应该是pytorch-geometric的版本问题,我们这里默认权重都是1,所以在edge_weight传入一个和edge_index长度相同的全为1的tensor即可

uuice11 commented 2 months ago

感谢您的回复,还有个疑问,就是train_syn()部分代码里已经包含了完整的训练和在原始图上测试的过程,为什么下面这里 #training on the condensed graph start = time.perf_counter() if args.model=='GCN': if args.dataset in ["cora","citeseer"]: model = GCN_PYG(nfeat=d, nhid=1024, nclass=nclass, dropout=0, nlayers=args.nlayers, norm=None, act=None).to(device)又选择了一个模型在合成图上训练然后在完整的图上测试

BangHonor commented 2 months ago

这个是用于直接在小图上完成GNN训练的,如果已经训练好了小图,想要在上面调参或者做NAS/KD这种任务,就不需要进入train_syn()这一步,直接加载小图训练GNN即可