pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
20.51k stars 3.57k forks source link

How to use benchmarks to repeat experiment? #1345

Open jiaruHithub opened 4 years ago

jiaruHithub commented 4 years ago

❓ Questions & Help

Hello,I try to run the benchmarks for graph classification.I don't know how to use the benchmarks. For example, I want to reproduce the SAGPool in D&D dataset like #859. Forgive me for being slow:).How do I operate?

shangguan9191 commented 4 years ago

i have same problem, i want to reproduce five different networks model for point cloud on ModelNet10 dataset. I got stuck there for 3 days.

rusty1s commented 4 years ago

You need to run main.py. If you only want to train a specific implementation/dataset, you can comment out all other models/datasets in nets and datasets. For a better logging experience, you can also pass logger to the cross_validation_with_val_set method.

jiaruHithub commented 4 years ago

You need to run main.py. If you only want to train a specific implementation/dataset, you can comment out all other models/datasets in nets and datasets. For a better logging experience, you can also pass logger to the cross_validation_with_val_set method.

Fine, thanks. Em...but I can't find this file,how can I call this file 'main.py'? Please Forgive me for being slow... :)

rusty1s commented 4 years ago

You just call it via python, see here.

jiaruHithub commented 4 years ago

You just call it via python, see here.

Thank you for your patient answer! the file eported an error:

Traceback (most recent call last):
  File "main.py", line 76, in <module>
    logger=None,
  File "\pytorch_geometric\benchmark\kernel\train_eval.py", line 19, in cross_validation_with_val_set
    val_idx) in enumerate(zip(*k_fold(dataset, folds))):
  File "\pytorch_geometric\benchmark\kernel\train_eval.py", line 93, in k_fold
    train_mask[test_indices[i]] = 0
IndexError: tensors used as indices must be long, byte or bool tensors

How can I handle this error? Thank you!

rusty1s commented 4 years ago

Seems to be Windows/numpy related. You can fix it by casting indices to long explicitly:

test_indices.append(torch.from_numpy(idx).to(torch.long))
jiaruHithub commented 4 years ago

test_indices.append(torch.from_numpy(idx).to(torch.long))

It's working!Thank you! But I have a question that instability of acc and experiment acc can't attend the paper claimed. Is the question relate the seed or Environment configuration?