pyHGT: Got low accuraccy when replicating the expirements on ogbn-mag dataset (due to torch-geometric 2.0.0). Fixed by downgrading to torch-geometric 1.5.0
Hello
I and my friend tried to replicate the experiment on the ogbn-mag dataset. We haven’t changed anything in configurations compared to the original code. You can see my running files at here: https://github.com/pdhung3012/pyHGT/blob/master/ogbn-mag/preprocess_ogbn_mag_RTX3090.py https://github.com/pdhung3012/pyHGT/blob/master/ogbn-mag/train_ogbn_mag_RTX3090.py https://github.com/pdhung3012/pyHGT/blob/master/ogbn-mag/eval_ogbn_mag_RTX3090.py
However, we couldn’t get the accuracy at around 0.5 like your experiment using Tesla graphic card. Here are I and my friend’s computers’ configurations:
Python 3.8 Nvvidia RTX 3090 (my friend used titan xp) Pytorch 1.8.0 Cuda 11.1
Configuration:
/home/hungphd/anaconda3/envs/py38/bin/python /home/hungphd/git/pyHGT/ogbn-mag/eval_ogbn_mag_RTX3090.py --prev_norm --last_norm --use_RTE +--------------+-----------------------+ | Parameter | Value | +--------------+-----------------------+ | data_dir | dataset_v1/OGB_MAG.pk | +--------------+-----------------------+ | model_dir | ./hgt_4layer | +--------------+-----------------------+ | task_type | variance_reduce | +--------------+-----------------------+ | vr_num | 8 | +--------------+-----------------------+ | n_pool | 8 | +--------------+-----------------------+ | n_batch | 32 | +--------------+-----------------------+ | batch_size | 128 | +--------------+-----------------------+ | conv_name | hgt | +--------------+-----------------------+ | n_hid | 512 | +--------------+-----------------------+ | n_heads | 8 | +--------------+-----------------------+ | n_layers | 4 | +--------------+-----------------------+ | cuda | 0 | +--------------+-----------------------+ | dropout | 0.200 | +--------------+-----------------------+ | sample_depth | 6 | +--------------+-----------------------+ | sample_width | 520 | +--------------+-----------------------+ | prev_norm | 1 | +--------------+-----------------------+ | last_norm | 1 | +--------------+-----------------------+ | use_RTE | 1 | +--------------+-----------------------+
We both achieved quite low accuracy:
Model #Params: 21173389 eval: 100%|██████████| 328/328 [1:07:18<00:00, 12.31s/it, accuracy=0.002] 0.0021459739144948616
Here is what we see when training:
Epoch: 93 LR: 0.00004 Train Loss: 4.2447 Train Acc: 0.1353 Valid Acc: 0.0956 Test Acc: 0.0021 Data Preparation: 17.0s Epoch: 94 LR: 0.00003 Train Loss: 4.2646 Train Acc: 0.1341 Valid Acc: 0.0928 Test Acc: 0.0021 Data Preparation: 16.2s Epoch: 95 LR: 0.00003 Train Loss: 4.2497 Train Acc: 0.1360 Valid Acc: 0.0945 Test Acc: 0.0017 Data Preparation: 12.8s Epoch: 96 LR: 0.00002 Train Loss: 4.2595 Train Acc: 0.1328 Valid Acc: 0.0989 Test Acc: 0.0021 Data Preparation: 13.3s Epoch: 97 LR: 0.00002 Train Loss: 4.2609 Train Acc: 0.1349 Valid Acc: 0.1002 Test Acc: 0.0016 Data Preparation: 13.3s Epoch: 98 LR: 0.00001 Train Loss: 4.2525 Train Acc: 0.1352 Valid Acc: 0.0954 Test Acc: 0.0012 Data Preparation: 14.1s Epoch: 99 LR: 0.00001 Train Loss: 4.2530 Train Acc: 0.1346 Valid Acc: 0.0967 Test Acc: 0.0021 Data Preparation: 12.8s Epoch: 100 LR: 0.00000 Train Loss: 4.2650 Train Acc: 0.1340 Valid Acc: 0.0981 Test Acc: 0.0019
Is there problem with the compatibility of the code with new version of pytorch/cuda/graphic card?
Sincerely
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 1
- Comments: 18 (4 by maintainers)
It seems that I got the code working with much better results using torch-geometric 1.5.0 (released in May 2020). I need to provide some small fixes in your code also. For example, the preprocess.py file missed the declaration of Evaluator and the node_year_dict should be updated to node_year.
Here is what I got. Is that seem normally?
Epoch: 51 LR: 0.00026 Train Loss: 1.4745 Train Acc: 0.5646 Valid Acc: 0.4391 Test Acc: 0.4235 Data Preparation: 22.6s Epoch: 52 LR: 0.00025 Train Loss: 1.4691 Train Acc: 0.5634 Valid Acc: 0.4395 Test Acc: 0.4405 Data Preparation: 21.9s Epoch: 53 LR: 0.00025 Train Loss: 1.4615 Train Acc: 0.5677 Valid Acc: 0.4418 Test Acc: 0.4142 Data Preparation: 21.6s Epoch: 54 LR: 0.00024 Train Loss: 1.4544 Train Acc: 0.5687 Valid Acc: 0.4288 Test Acc: 0.4125 Data Preparation: 21.4s Epoch: 55 LR: 0.00024 Train Loss: 1.4552 Train Acc: 0.5692 Valid Acc: 0.4374 Test Acc: 0.4250 Data Preparation: 21.2s UPDATE!!! 0.4516340750319941