Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: too many indices for tensor of dimension 1 #21

Open
Jack-Lin-gif opened this issue Oct 27, 2021 · 4 comments
Open

IndexError: too many indices for tensor of dimension 1 #21

Jack-Lin-gif opened this issue Oct 27, 2021 · 4 comments

Comments

@Jack-Lin-gif
Copy link

Jack-Lin-gif commented Oct 27, 2021

Thanks for sharing your great code!
I'm trying to run your sample code:

python seal_link_pred.py --dataset ogbl-ppa --num_hops 1 --use_feature --use_edge_weight --eval_steps 5 --epochs 20 --dynamic_train --dynamic_val --dynamic_test --train_percent 5

there is an 'IndexError':

Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/anaconda3/envs/seal2/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/opt/anaconda3/envs/seal2/lib/python3.8/multiprocessing/spawn.py", line 125, in _main prepare(preparation_data) File "/opt/anaconda3/envs/seal2/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/opt/anaconda3/envs/seal2/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "/opt/anaconda3/envs/seal2/lib/python3.8/runpy.py", line 265, in run_path return _run_module_code(code, init_globals, run_name, File "/opt/anaconda3/envs/seal2/lib/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/opt/anaconda3/envs/seal2/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/shanghanglin/SEAL_OGB/seal_link_pred.py", line 702, in <module> loggers[key].print_statistics() File "/Users/shanghanglin/SEAL_OGB/utils.py", line 364, in print_statistics valid = r[:, 0].max().item() IndexError: too many indices for tensor of dimension 1

Could you please help me with that? Thank you!

@muhanzhang
Copy link
Collaborator

Hi! Can you let me know which versions of PyTorch, PyG, OGB you used? Thanks.

@Jack-Lin-gif
Copy link
Author

Thanks for your reply.

PyTouch: 1.6.0
PyG: 2.0.1
OGB: 1.2.4

@Jack-Lin-gif
Copy link
Author

I just can’t find a way to install a specific version of PyG...like your version of 1.6.1. Could you help me?

@muhanzhang
Copy link
Collaborator

Hi! I have tested the repo with PyTorch 1.9.0, OGB 1.3.1 and PyG 2.0.2. Maybe your OGB version is too old. Can you update it by "pip install -U ogb"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants