twitter-research / graph-neural-pde

Graph Neural PDEs
Apache License 2.0
317 stars 52 forks source link

python run_GNN.py --dataset Cora #8

Closed Saydemr closed 2 years ago

Saydemr commented 2 years ago

Hello,

When I run python run_GNN.py --dataset Cora , it creates the following error.

Traceback (most recent call last): File "run_GNN.py", line 401, in main(opt) File "run_GNN.py", line 190, in main dataset = get_dataset(opt, '../data', opt['not_lcc']) File "/home/saydemr/Documents/graph-neural-pde/src/data.py", line 36, in get_dataset dataset = Planetoid(path, ds) File "/home/saydemr/anaconda3/envs/grand/lib/python3.7/site-packages/torch_geometric/datasets/planetoid.py", line 56, in init self.data, self.slices = torch.load(self.processed_paths[0]) File "/home/saydemr/anaconda3/envs/grand/lib/python3.7/site-packages/torch/serialization.py", line 592, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/saydemr/anaconda3/envs/grand/lib/python3.7/site-packages/torch/serialization.py", line 851, in _load result = unpickler.load() ModuleNotFoundError: No module named 'torch_geometric.data.storage'

System : Ubuntu 20.04 Torch : 1.8.1+cu102 Cuda : release 10.2, V10.2.89 torch-geometric==1.7.0

On torch-geometric==2.0.2 however, this error turns into the following

Traceback (most recent call last): File "run_GNN.py", line 401, in main(opt) File "run_GNN.py", line 202, in main model = GNN(opt, dataset, device).to(device) if opt["no_early"] else GNNEarly(opt, dataset, device).to(device) File "/home/saydemr/Documents/graph-neural-pde/src/GNN_early.py", line 25, in init self.odeblock = block(self.f, self.regularization_fns, opt, dataset.data, device, t=time_tensor).to(device) File "/home/saydemr/Documents/graph-neural-pde/src/block_transformer_attention.py", line 16, in init dtype=data.x.dtype) File "/home/saydemr/Documents/graph-neural-pde/src/utils.py", line 113, in get_rw_adj edge_index, edge_weight, fill_value, num_nodes) File "/home/saydemr/anaconda3/envs/grand/lib/python3.7/site-packages/torch_geometric/utils/loop.py", line 220, in add_remaining_self_loops raise AttributeError("No valid 'fill_value' provided") AttributeError: No valid 'fill_value' provided

JRowbottomGit commented 2 years ago

Hi Abdullah,

The code definitely won’t run with pytorch geometric >= 2.0.0.

There were many changes. See here for release notes https://github.com/pyg-team/pytorch_geometric/releases.

Two things to check:

Good luck!

James

From: Abdullah @.> Sent: 07 December 2021 21:57 To: twitter-research/graph-neural-pde @.> Cc: Subscribed @.***> Subject: [twitter-research/graph-neural-pde] python run_GNN.py --dataset Cora (Issue #8)

Hello,

When I run python run_GNN.py --dataset Cora , it creates the following error.

Traceback (most recent call last): File "run_GNN.py", line 401, in main(opt) File "run_GNN.py", line 190, in main dataset = get_dataset(opt, '../data', opt['not_lcc']) File "/home/saydemr/Documents/graph-neural-pde/src/data.py", line 36, in get_dataset dataset = Planetoid(path, ds) File "/home/saydemr/anaconda3/envs/grand/lib/python3.7/site-packages/torch_geometric/datasets/planetoid.py", line 56, in init self.data, self.slices = torch.load(self.processed_paths[0]) File "/home/saydemr/anaconda3/envs/grand/lib/python3.7/site-packages/torch/serialization.py", line 592, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/saydemr/anaconda3/envs/grand/lib/python3.7/site-packages/torch/serialization.py", line 851, in _load result = unpickler.load() ModuleNotFoundError: No module named 'torch_geometric.data.storage'

System : Ubuntu 20.04 Torch : 1.8.1+cu102 Cuda : release 10.2, V10.2.89 torch-geometric==1.7.0

On torch-geometric==2.0.2 however, this error turns into the following

Traceback (most recent call last): File "run_GNN.py", line 401, in main(opt) File "run_GNN.py", line 202, in main model = GNN(opt, dataset, device).to(device) if opt["no_early"] else GNNEarly(opt, dataset, device).to(device) File "/home/saydemr/Documents/graph-neural-pde/src/GNN_early.py", line 25, in init self.odeblock = block(self.f, self.regularization_fns, opt, dataset.data, device, t=time_tensor).to(device) File "/home/saydemr/Documents/graph-neural-pde/src/block_transformer_attention.py", line 16, in init dtype=data.x.dtype) File "/home/saydemr/Documents/graph-neural-pde/src/utils.py", line 113, in get_rw_adj edge_index, edge_weight, fill_value, num_nodes) File "/home/saydemr/anaconda3/envs/grand/lib/python3.7/site-packages/torch_geometric/utils/loop.py", line 220, in add_remaining_self_loops raise AttributeError("No valid 'fill_value' provided") AttributeError: No valid 'fill_value' provided

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/twitter-research/graph-neural-pde/issues/8 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APWNPYOPHSYJDPONDAKEPMDUPZ7KBANCNFSM5JSJENJQ . https://github.com/notifications/beacon/APWNPYIBRTCGWBHTXLA7ZZ3UPZ7KBA5CNFSM5JSJENJ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4QAAV3CQ.gif

Saydemr commented 2 years ago

OK. Problem solved. However, code does not run with torchdiffeq==0.2.1. Would you consider updating Readme.md with torchdiffeq==0.2.2? #5 persists for version 0.2.1

Thanks!

JRowbottomGit commented 2 years ago

Hi Abdullah,

Thanks for following up as I’m sure it would have caused others headaches.

I believe this https://github.com/twitter-research/graph-neural-pde/blob/83bbb5ae89c84b133448e91b5774702397b3b5b4/src/early_stop_solver.py#L287 is our problem line of code.

I checked the torchdiffeq pip library release schedule https://pypi.org/project/torchdiffeq/#history and git commit history https://github.com/rtqichen/torchdiffeq/commits/master/torchdiffeq/_impl/misc.py (07/08/2020) and manually checked the signature, results as follows:

from torchdiffeq._impl.misc import _check_inputs

env TDEQ_010

def _check_inputs(func, y0, t, rtol, atol, method, options, SOLVERS):

env TDEQ_011

def _check_inputs(func, y0, t, rtol, atol, method, options, SOLVERS):

env TDEQ_020

def _check_inputs(func, y0, t, rtol, atol, method, options, event_fn, SOLVERS):

env TDEQ_021

def _check_inputs(func, y0, t, rtol, atol, method, options, event_fn, SOLVERS):

I’ve pushed the fix (>=0.2.0) and closed the issue. Please let me know if it works for you.

From: Abdullah @.> Sent: 08 December 2021 07:32 To: twitter-research/graph-neural-pde @.> Cc: JRowbottomGit @.>; Comment @.> Subject: Re: [twitter-research/graph-neural-pde] python run_GNN.py --dataset Cora (Issue #8)

OK. Problem solved. However, code does not run with torchdiffeq==0.2.1. Would you consider updating Readme.md with torchdiffeq==0.2.2. #5 https://github.com/twitter-research/graph-neural-pde/issues/5 persists for version 0.2.1

Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/twitter-research/graph-neural-pde/issues/8#issuecomment-988567240 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APWNPYLM2INIHELWYWGKE7DUP4CXNANCNFSM5JSJENJQ . https://github.com/notifications/beacon/APWNPYPR3LQ52SJ57PULTZ3UP4CXNA5CNFSM5JSJENJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLWFNSA.gif