P-GNN
P-GNN copied to clipboard
AttributeError: 'Graph' object has no attribute 'selfloop_edges'
Hello @JiaxuanYou,
Thank you for the code.
I am trying to run python main.py --model PGNN --layer_num 2 --dataset grid
However, it gives the following error:
File "main.py", line 51, in <module>
data_list = get_tg_dataset(args, dataset_name, use_cache=args.cache, remove_feature=args.rm_feature)
File "P-GNN/dataset.py", line 36, in get_tg_dataset
dataset = load_tg_dataset(dataset_name)
File "P-GNN/dataset.py", line 387, in load_tg_dataset
return nx_to_tg_data(graphs, features, edge_labels)
File "P-GNN/dataset.py", line 134, in nx_to_tg_data
graph.remove_edges_from(graph.selfloop_edges())
AttributeError: 'Graph' object has no attribute 'selfloop_edges'
Could you please help me resolve this error? Thank you, Supriya
Hello @JiaxuanYou, Thank you for the code. I am trying to run
python main.py --model PGNN --layer_num 2 --dataset grid
However, it gives the following error:File "main.py", line 51, in <module> data_list = get_tg_dataset(args, dataset_name, use_cache=args.cache, remove_feature=args.rm_feature) File "P-GNN/dataset.py", line 36, in get_tg_dataset dataset = load_tg_dataset(dataset_name) File "P-GNN/dataset.py", line 387, in load_tg_dataset return nx_to_tg_data(graphs, features, edge_labels) File "P-GNN/dataset.py", line 134, in nx_to_tg_data graph.remove_edges_from(graph.selfloop_edges()) AttributeError: 'Graph' object has no attribute 'selfloop_edges'
Could you please help me resolve this error? Thank you, Supriya
You can use nx.selfloop_edges(graph)
instead of graph.selfloop_edges()
.