VITA-Group / Graph-Mixture-of-Experts

[NeurIPS'23] Graph Mixture of Experts: Learning on Large-Scale Graphs with Explicit Diversity Modeling. Haotao Wang, Ziyu Jiang, Yuning You, Yan Han, Gaowen Liu, Jayanth Srinivasa, Ramana Rao Kompella, Zhangyang Wang
MIT License
30 stars 2 forks source link

ERROR: Exception: Now using drop node, which doesn't support mixed training/eval yet! #5

Open spidercatfly opened 5 months ago

spidercatfly commented 5 months ago

Hi All!

I try to train the model following the example:

python main_pyg.py --dataset ogbg-molhiv -n 8 --n1 4 -k 4 -d 150 --device 0 --gnn gcn-spmoe --coef 1

Here raises an error:

=====Epoch 1
Traceback (most recent call last):
  File "./graphproppred/main_pyg.py", line 373, in <module>
    main()
  File "./graphproppred/main_pyg.py", line 306, in main
    raise Exception("Now using drop node, which doesn't support mixed training/eval yet!")
Exception: Now using drop node, which doesn't support mixed training/eval yet!

The original code:

        if 'moe' in args.gnn:
            if 'moe' in args.gnn and args.num_experts_1hop == 0:
                raise Exception("No longer support two hop datasets after applying random node drop!")
                print('Training...')
                train(model, device, train_loader_2hop, optimizer, dataset.task_type)
                print('Evaluating...')
                train_perf = eval(model, device, train_loader_2hop, evaluator)
                valid_perf = eval(model, device, valid_loader_2hop, evaluator)
                test_perf = eval(model, device, test_loader_2hop, evaluator)
            elif 'moe' in args.gnn and args.num_experts_1hop == args.num_experts:
                print('Training...')
                train(model, device, train_loader, optimizer, dataset.task_type)
                print('Evaluating...')
                # train_perf = eval(model, device, train_loader, evaluator)
                valid_perf = eval(model, device, valid_loader, evaluator)
                test_perf = eval(model, device, test_loader, evaluator)
            else:
                raise Exception("Now using drop node, which doesn't support mixed training/eval yet!")
                print('Training mixed...')
                train_mixed(model, device, train_loader, train_loader_2hop, optimizer, dataset.task_type)
                print('Evaluating mixed...')
                train_perf = eval_mixed(model, device, train_loader, train_loader_2hop, evaluator)
                valid_perf = eval_mixed(model, device, valid_loader, valid_loader_2hop, evaluator)
                test_perf = eval_mixed(model, device, test_loader, test_loader_2hop, evaluator)

Is it because the model only supports either all one-hop or all two-hop experts? I'm also confused why if we drop nodes, the model no longer supports two-hop experts?

Thanks for your help! @htwang14 , @Ir1d , @Syzygianinfern0

lin-uice commented 1 month ago

Could you adress the issure? Could you tell me your solvation? I am very hopeful for your reply!