Closed shubhamrsangle closed 4 years ago
Hi, Can you redirect stdout and stderr to files so we can see what is written before the terminal closes?
I did as you said and got this:
Traceback (most recent call last):
File "code2vec.py", line 1, in
I tried running vocabularies.py individually even then I got same issue
data.zip This I am attaching data folder, you can extract it and try running it, it won't take time as data is very very small (1-2 code files).
I think that your python version is too old. Can you run python --version
?
Okk, will try
On Mon 13 Jan, 2020, 8:01 PM Uri Alon, notifications@github.com wrote:
I think that your python version is too old. Can you run python --version?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tech-srl/code2vec/issues/61?email_source=notifications&email_token=AIY42NGEFJ24O6OBYVCKFIDQ5R3LZA5CNFSM4KF7VEZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIY5FQQ#issuecomment-573690562, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIY42NCWJABVEZFZ6QG3TODQ5R3LZANCNFSM4KF7VEZA .
Issue solved by changing tensorflow version to 2.0.0 from 2.1.0
Great, I'm glad to hear!
Thanks for your help, it will be great if you add this in Readme that Python version should be greater than or equal to 3.6.
Also it will be great if you could help me through this.
As this is mentioned in Readme that
If used with the --test
Now, I trained model for cpp so
when I run this command
python3 code2vec.py --load models/cpp/saved_model.release --export_code_vectors --test AMNOI.cpp
I am getting error
Traceback (most recent call last): File "/home/shubham/.local/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call return fn(*args) File "/home/shubham/.local/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn target_list, run_metadata) File "/home/shubham/.local/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: Expect 201 fields but have 2 in record [[{{node IteratorGetNext}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "code2vec.py", line 31, in
Original stack trace for 'IteratorGetNext':
File "code2vec.py", line 31, in
and when I am running this command
python3 code2vec.py --load models/cpp/saved_model.release --export_code_vectors --predict
It's by default opening input.java but I trained model for CPP
Hello,
I tried training model with command source train.sh, but terminal closes as soon as I run this command. models directory is getitng created and one more directory inside it named as type in train.sh also created, but it's empty.
Can you tell me why terminal closes and why those folder is empty.
#!/usr/bin/env bash
###########################################################
# Change the following values to train a new model.
# type: the name of the new model, only affects the saved file name.
# dataset: the name of the dataset, as was preprocessed using preprocess.sh
# test_data: by default, points to the validation set, since this is the set that
# will be evaluated after each training iteration. If you wish to test
# on the final (held-out) test set, change 'val' to 'test'.
type=cpp
dataset_name=AMNOI
data_dir=data/${dataset_name}
data=${data_dir}/${dataset_name}
test_data=${data_dir}/${dataset_name}.val.c2v
model_dir=models/${type}
mkdir -p models/${model_dir}
set -e
python3 -u code2vec.py --data ${data} --test ${test_data} --save ${model_dir}/saved_model
Image shows that my data folder is not empty and path to it