tech-srl / code2vec

TensorFlow code for the neural network presented in the paper: "code2vec: Learning Distributed Representations of Code"
https://code2vec.org
MIT License
1.09k stars 285 forks source link

File Not found error #183

Closed YogishGayatri closed 8 months ago

YogishGayatri commented 9 months ago

Hi code2vec team, I tried to preprocess the small java data set , i also updated the path for test, train and validation, if there are no subdirectories then c2v files for the same is being generated and works fine but if there are subdirectories under the train, test or validation files following error is thrown

" Extracting paths from validation set... multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "C:\Users\yhi6\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 125, in worker result = (True, func(*args, kwds)) File "C:\Users\yhi6\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 51, in starmapstar return list(itertools.starmap(args[0], args[1])) File "D:\VSCODE\CODETOVEC\code2vec\JavaExtractor\extract.py", line 21, in ParallelExtractDir ExtractFeaturesForDir(args,tmpdir, dir_, "") File "D:\VSCODE\CODETOVEC\code2vec\JavaExtractor\extract.py", line 33, in ExtractFeaturesForDir with open(outputFileName, 'a') as outputFile: FileNotFoundError: [Errno 2] No such file or directory: './tmp/feature_extractor10488/java-small\validation\libgdx'** """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\VSCODE\CODETOVEC\code2vec\JavaExtractor\extract.py", line 92, in ExtractFeaturesForDirsList(args, to_extract) File "D:\VSCODE\CODETOVEC\code2vec\JavaExtractor\extract.py", line 63, in ExtractFeaturesForDirsList p.starmap(ParallelExtractDir, zip(itertools.repeat(args),itertools.repeat(tmp_dir), dirs)) File "C:\Users\yhi6\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 372, in starmap return self._map_async(func, iterable, starmapstar, chunksize).get() File "C:\Users\yhi6\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 771, in get raise self._value FileNotFoundError: [Errno 2] No such file or directory: './tmp/feature_extractor10488/java-small\validation\libgdx' Finished extracting paths from validation set Extracting paths from test set... multiprocessing.pool.RemoteTraceback: "

I suspect that this error might have been created because of wrong path generation as highlighted above Please guide me through this Thanks in advance!

urialon commented 8 months ago

Hi @YogishGayatri , Thank you for your interest in our work!

It might be an issue of Windows vs. Linux. This script was designed to work under Linux.

Best, Uri

YogishGayatri commented 8 months ago

Thankyou !!