1. ホーム
  2. pytorch

AttributeError: 'Graph' オブジェクトには 'node' という属性がありません。

2022-02-20 22:07:41
<パス
Traceback (most recent call last):
  File "src/main.py", line 24, in <module>
    main()
  File "src/main.py", line 18, in main
    clustering_machine.decompose()
  File "/root/userfolder/GCN/ClusterGCN/src/clustering.py", line 38, in decompose
    self.metis_clustering()
  File "/root/userfolder/GCN/ClusterGCN/src/clustering.py", line 56, in metis_clustering
    (st, parts) = metis.part_graph(self.graph, self.args.cluster_number)
  File "/root/userfolder/anaconda3/envs/GCN/lib/python3.5/site-packages/metis.py", line 765, in part_graph
    graph = networkx_to_metis(graph)
  File "/root/userfolder/anaconda3/envs/GCN/lib/python3.5/site-packages/metis.py", line 574, in networkx_to_metis
    for i in H.node:
AttributeError: 'Graph' object has no attribute 'node'


networkx モジュールを再インストールするだけ

pip install networkx==2.3