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

AttributeError: 'Graph' object has no attribute 'selfloop_edges' #16

Open
supriya-gdptl opened this issue Apr 23, 2020 · 1 comment
Open

Comments

@supriya-gdptl
Copy link

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

@dreamhomes
Copy link

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().

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