aditya-grover / node2vec

http://snap.stanford.edu/node2vec/
MIT License
2.6k stars 912 forks source link

IOError: [Errno 2] No such file or directory: 'graph/karate.edgelist' #70

Open renmi001 opened 5 years ago

renmi001 commented 5 years ago

problem when running main.py: Traceback (most recent call last): File "D:/node2vec-master/src/main.py", line 104, in main(args) File "D:/node2vec-master/src/main.py", line 96, in main nx_G = read_graph() File "D:/node2vec-master/src/main.py", line 73, in read_graph G = nx.read_edgelist(args.input, nodetype=int, create_using=nx.DiGraph()) File "<D:\Anaconda2\lib\site-packages\decorator.pyc:decorator-gen-170>", line 2, in read_edgelist File "D:\Anaconda2\lib\site-packages\networkx\utils\decorators.py", line 198, in _open_file fobj = _dispatch_dict[ext](path, mode=mode) IOError: [Errno 2] No such file or directory: 'graph/karate.edgelist'

but the file exists,so please help me solve this question,thank you ! image

dongcy-AHU commented 5 years ago

I have the same error with you. Have you solved this problem yet? Could you help me?Thank you very much!

raulqf commented 5 years ago

Maybe it's because the OS route path. Use os.path.join('graph','karate.edgelist') to define the input filename.

dongcy-AHU commented 5 years ago

Maybe it's because the OS route path. Use os.path.join('graph','karate.edgelist') to define the input filename.

I try to import os module and modify the input filename to become os.path.join('graph','karate.edgelist'),but still have the same problem FileNotFoundError: [Errno 2] No such file or directory: 'graph\karate.edgelist'.

raulqf commented 5 years ago

Use the absolute path instead or the relative one to discard problems with the path.

Jak32 commented 3 years ago

If you want relative path just change it like the image below. That happen because the main code runs on 'src' folder and not in root directory. image