Closed ariewahyu closed 5 years ago
Which version of networkx are you using? The current code works with networkx 1.11
I changed to networx 1.11, python 2.7. Then the error changed to this:
Traceback (most recent call last): File "evaluate.py", line 69, in <module> api.InsertGraph(g, is_test=True) File "/home/abcd/graph_comb_opt/code/s2v_maxcut/maxcut_lib/maxcut_lib.py", line 45, in InsertGraph n_nodes, n_edges, e_froms, e_tos, weights = self.__CtypeNetworkX(g) File "/home/abcd/graph_comb_opt/code/s2v_maxcut/maxcut_lib/maxcut_lib.py", line 24, in __CtypeNetworkX edges = list(g.edges_iter(data='weight', default=1)) File "/home/abcd/anaconda2/envs/my-env/lib/python2.7/site-packages/networkx-1.11-py2.7.egg/networkx/classes/graph.py", line 1191, in edges_iter nodes_nbrs = self.adj.items() AttributeError: 'Graph' object has no attribute 'adj'
In case anyone else had this problem, it was resolved by changing edges_iter to edges.
I managed to execute run_nstep_dqn.sh of s2v_maxcut. But, I got this error when executing run_eval.sh:
Traceback (most recent call last): File "evaluate.py", line 69, in <module> api.InsertGraph(g, is_test=True) File "/home/abcd/graph_comb_opt/code/s2v_maxcut/maxcut_lib/maxcut_lib.py", line 45, in InsertGraph n_nodes, n_edges, e_froms, e_tos, weights = self.__CtypeNetworkX(g) File "/home/abcd/graph_comb_opt/code/s2v_maxcut/maxcut_lib/maxcut_lib.py", line 24, in __CtypeNetworkX edges = list(g.edges_iter(data='weight', default=1)) AttributeError: 'Graph' object has no attribute 'edges_iter'