phanein / deepwalk

DeepWalk - Deep Learning for Graphs
http://www.perozzi.net/projects/deepwalk/
Other
2.67k stars 828 forks source link

default factory changed? #117

Closed EtienneGagnon1 closed 4 years ago

EtienneGagnon1 commented 4 years ago

I think the default_factory attribute of the Graph() has been changed from List to default_dict? When I try to load an edgelist now this error appears:

Traceback (most recent call last):
  File "C:\Users\Etienne Gagnon\Anaconda3\envs\modified_deepwalk\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Etienne Gagnon\Anaconda3\envs\modified_deepwalk\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Etienne Gagnon\PycharmProjects\modified_deepwalk\mod_deepwalk\__main__.py", line 186, in <module>
    sys.exit(main())
  File "C:\Users\Etienne Gagnon\PycharmProjects\modified_deepwalk\mod_deepwalk\__main__.py", line 182, in main
    process(args)
  File "C:\Users\Etienne Gagnon\PycharmProjects\modified_deepwalk\mod_deepwalk\__main__.py", line 66, in process
    G = graph.load_edgelist(args.input, undirected=args.undirected)
  File "C:\Users\Etienne Gagnon\PycharmProjects\modified_deepwalk\mod_deepwalk\graph.py", line 290, in load_edgelist
    G[x].append(y)
AttributeError: 'collections.defaultdict' object has no attribute 'append'
GTmac commented 4 years ago

It should still be List: https://github.com/phanein/deepwalk/blob/master/deepwalk/graph.py#L32 is there any chance you are not using the original graph.py?

EtienneGagnon1 commented 4 years ago

Yeah I did some modifications a long time ago seems like it is on my end.