ChandlerBang / GCond

[ICLR'22] [KDD'22] [IJCAI'24] Implementation of "Graph Condensation for Graph Neural Networks"
https://www.cs.emory.edu/~wjin30/files/GCond.pdf
118 stars 16 forks source link

Error raised from the command ``python train_coreset.py'' #13

Closed jiaweiz716 closed 5 months ago

jiaweiz716 commented 5 months ago

Hi, thanks for the great work!

When I run the command : python train_coreset.py --dataset cora --r=0.01 --method=herding

there are errors raised, as follows:

Namespace(dataset='cora', epochs=400, gpu_id=0, hidden=256, inductive=1, keep_ratio=1.0, lr=0.01, method='herding', nlayers=2, normalize_features=True, reduction_rate=0.01, save=0, seed=15, weight_decay=0.0005)
size of adj_train: (140, 140)
#edges in adj_train: 42.0
WARNING:root:The OGB package is out of date. Your version is 1.3.0, while the latest version is 1.3.6.
Traceback (most recent call last):
  File "train_coreset.py", line 66, in <module>
    model.fit(features, adj, labels, idx_train, idx_val, train_iters=600, verbose=False)
  File "/home/s50036442/miniconda3/envs/gdc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 778, in __getattr__
    raise ModuleAttributeError("'{}' object has no attribute '{}'".format(
torch.nn.modules.module.ModuleAttributeError: 'GCN' object has no attribute 'fit'

It seems that the GCN model lacks the function model.fit(...).

Can you provide the fit() function?

ChandlerBang commented 5 months ago

I have added the function. Can you pull the code and rerun the program?

Thanks.

jiaweiz716 commented 5 months ago

Thanks! It works.