phanein / deepwalk

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

load_adjacency-list no reaction #37

Closed Mrliuzhengming closed 7 years ago

Mrliuzhengming commented 7 years ago

HI Phanein, i want to load a graph using G = graph.load_adjacencylist('adjedges.txt'),but there are something wrong ,when i run the code: daada numbers are some flag: daima 'adjedges.txt' is as follow: adj

GTmac commented 7 years ago

Can you provide me with more details about the issue? I am not sure what do you mean by "no reaction". Thanks!

Mrliuzhengming commented 7 years ago

@GTmac ,thank you for reply. when i run G = graph.load_adjacencylist('adjedges.txt'),this should be load adjedges.txt to G,but code is keeping running,have no result.so i decide to set some flag in code "load_adjacencylist":such as "print "4....""in the picture2. but code can't go through the follow part:

laalalall

,and more strangely the code go back to run again..,you can see in picture1..

phanein commented 7 years ago

That method tries to load the file in parallel.

How big is your file? What does your ram usage look like? (you may be running out of ram, which will slow everything down).

On Mon, May 15, 2017 at 8:01 PM, Mrliuzhengming notifications@github.com wrote:

@GTmac https://github.com/gtmac ,thank you for reply. when i run G = graph.load_adjacencylist('adjedges.txt'),this should be load adjedges.txt to G,but code is keeping running,have no result.so i decide to set some flag in code "load_adjacencylist":such as "print "4....""in the picture2. but code can't go through the follow part:

[image: laalalall] https://cloud.githubusercontent.com/assets/24410626/26084287/aaf20aaa-3a0d-11e7-8548-2e93350e2e45.PNG

,and more strangely the code go back to run again..,you can see in picture1..

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/phanein/deepwalk/issues/37#issuecomment-301637628, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEo0ceYw7vaI1FvuXAMLLeVJurvKCSyks5r6OdQgaJpZM4NbFtT .

Mrliuzhengming commented 7 years ago

@phanein yes,it's a problem in parallel.the file is only 1.16M(dataset from dblp ).my ram is 24G. An error occurred"RuntimeError on windows trying python multiprocessing...".reference the follow link,i solve the problem,add a head, if name == 'main': freeze_support() ...... link:http://stackoverflow.com/questions/28830697/runtimeerror-on-windows-trying-python-multiprocessing but i don't think this is a good way,is there any other way to solve this problem?

GTmac commented 7 years ago

@Mrliuzhengming check the first answer under this question: http://stackoverflow.com/questions/18204782/runtimeerror-on-windows-trying-python-multiprocessing

On Windows the subprocesses will import (i.e. execute) the main module at start. You need to protect the main code like this to avoid creating subprocesses recursively:


import parallelTestModule

if name == 'main':
extractor = parallelTestModule.ParallelExtractor() extractor.runInParallel(numProcesses=2, numThreads=4)



Actually, I think wrap your code inside the main module is good practice -- code on the module level may cause undesired side effects.
phanein commented 7 years ago

The other answer is that this code wasn't designed for / tested on Windows.

On May 17, 2017 6:04 PM, "Haochen Chen" notifications@github.com wrote:

@Mrliuzhengming https://github.com/mrliuzhengming check the first answer under this question: http://stackoverflow.com/questions/18204782/ runtimeerror-on-windows-trying-python-multiprocessing

On Windows the subprocesses will import (i.e. execute) the main module at start. You need to protect the main code like this to avoid creating subprocesses recursively:

import parallelTestModule

if name == 'main': extractor = parallelTestModule.ParallelExtractor() extractor.runInParallel(numProcesses=2, numThreads=4)

Actually, I think wrap your code inside the main module is good practice -- code on the module level may cause undesired side effects.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/phanein/deepwalk/issues/37#issuecomment-302244683, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEo0eJLLg3J7i5dyEZDy1fCqY_w8oOsks5r6276gaJpZM4NbFtT .

aswathydiv36 commented 6 years ago
Traceback (most recent call last): File "main.py", line 165, in sys.exit(main()) File "main.py", line 162, in main process(args) File "main.py", line 93, in process walks_corpus = serialized_walks.WalksCorpus(walk_files) 

AttributeError: 'module' object has no attribute 'WalksCorpus'

Why do I get this error?

GTmac commented 6 years ago

@aswathydiv36 Several questions:

  1. Are you using Python 2 or Python 3?
  2. What OS do you use?
  3. What is the exact command you use to run DeepWalk?