Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run Step 4: Manual examination of a trained model #52

Closed
francefa opened this issue Nov 12, 2019 · 2 comments
Closed

Cannot run Step 4: Manual examination of a trained model #52

francefa opened this issue Nov 12, 2019 · 2 comments

Comments

@francefa
Copy link

Hello,
I'm trying to run the command
python3 code2vec.py --load models/java14_model/saved_model_iter8.release --predict
but i found these error below.:

~/code2vec$ python3 code2vec.py --load models/java14_model/saved_model_iter8.release --predict
2019-11-13 00:48:00.400601: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory
2019-11-13 00:48:00.400716: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2019-11-13 00:50:06.233454: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2019-11-13 00:50:06.808643: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-11-13 00:50:06.813225: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 950M computeCapability: 5.0
coreClock: 0.928GHz coreCount: 5 deviceMemorySize: 3.95GiB deviceMemoryBandwidth: 74.65GiB/s
2019-11-13 00:50:06.813965: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory
2019-11-13 00:50:06.814661: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcublas.so.10.0'; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory
2019-11-13 00:50:06.815327: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcufft.so.10.0'; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory
2019-11-13 00:50:06.816016: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcurand.so.10.0'; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory
2019-11-13 00:50:06.816684: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusolver.so.10.0'; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory
2019-11-13 00:50:06.817445: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusparse.so.10.0'; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory
2019-11-13 00:50:11.048508: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2019-11-13 00:50:11.048636: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1592] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2019-11-13 00:50:11.050286: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-11-13 00:50:11.541359: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2712000000 Hz
2019-11-13 00:50:11.542624: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55cd55e30800 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2019-11-13 00:50:11.542733: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2019-11-13 00:50:12.295303: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-11-13 00:50:12.297222: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55cd56f8ec30 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2019-11-13 00:50:12.297333: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce GTX 950M, Compute Capability 5.0
2019-11-13 00:50:12.297654: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1096] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-11-13 00:50:12.297710: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102]
2019-11-13 00:50:12,299 INFO
2019-11-13 00:50:12,300 INFO
2019-11-13 00:50:12,300 INFO ---------------------------------------------------------------------
2019-11-13 00:50:12,300 INFO ---------------------------------------------------------------------
2019-11-13 00:50:12,301 INFO ---------------------- Creating word2vec model ----------------------
2019-11-13 00:50:12,301 INFO ---------------------------------------------------------------------
2019-11-13 00:50:12,301 INFO ---------------------------------------------------------------------
2019-11-13 00:50:12,301 INFO Checking number of examples ...
2019-11-13 00:50:12,302 INFO ---------------------------------------------------------------------
2019-11-13 00:50:12,302 INFO ----------------- Configuration - Hyper Parameters ------------------
2019-11-13 00:50:12,303 INFO CODE_VECTOR_SIZE 384
2019-11-13 00:50:12,303 INFO CSV_BUFFER_SIZE 104857600
2019-11-13 00:50:12,304 INFO DEFAULT_EMBEDDINGS_SIZE 128
2019-11-13 00:50:12,304 INFO DL_FRAMEWORK tensorflow
2019-11-13 00:50:12,304 INFO DROPOUT_KEEP_RATE 0.75
2019-11-13 00:50:12,305 INFO EXPORT_CODE_VECTORS False
2019-11-13 00:50:12,305 INFO LOGS_PATH None
2019-11-13 00:50:12,305 INFO MAX_CONTEXTS 200
2019-11-13 00:50:12,306 INFO MAX_PATH_VOCAB_SIZE 911417
2019-11-13 00:50:12,306 INFO MAX_TARGET_VOCAB_SIZE 261245
2019-11-13 00:50:12,306 INFO MAX_TOKEN_VOCAB_SIZE 1301136
2019-11-13 00:50:12,306 INFO MAX_TO_KEEP 10
2019-11-13 00:50:12,306 INFO MODEL_LOAD_PATH models/java14_model/saved_model_iter8.release
2019-11-13 00:50:12,307 INFO MODEL_SAVE_PATH None
2019-11-13 00:50:12,307 INFO NUM_BATCHES_TO_LOG_PROGRESS 100
2019-11-13 00:50:12,307 INFO NUM_TEST_EXAMPLES 0
2019-11-13 00:50:12,307 INFO NUM_TRAIN_BATCHES_TO_EVALUATE 1800
2019-11-13 00:50:12,307 INFO NUM_TRAIN_EPOCHS 20
2019-11-13 00:50:12,308 INFO NUM_TRAIN_EXAMPLES 0
2019-11-13 00:50:12,308 INFO PATH_EMBEDDINGS_SIZE 128
2019-11-13 00:50:12,308 INFO PREDICT True
2019-11-13 00:50:12,308 INFO READER_NUM_PARALLEL_BATCHES 6
2019-11-13 00:50:12,308 INFO RELEASE False
2019-11-13 00:50:12,309 INFO SAVE_EVERY_EPOCHS 1
2019-11-13 00:50:12,309 INFO SAVE_T2V None
2019-11-13 00:50:12,309 INFO SAVE_W2V None
2019-11-13 00:50:12,309 INFO SEPARATE_OOV_AND_PAD False
2019-11-13 00:50:12,309 INFO SHUFFLE_BUFFER_SIZE 10000
2019-11-13 00:50:12,309 INFO TARGET_EMBEDDINGS_SIZE 384
2019-11-13 00:50:12,310 INFO TEST_BATCH_SIZE 1024
2019-11-13 00:50:12,310 INFO TEST_DATA_PATH None
2019-11-13 00:50:12,310 INFO TOKEN_EMBEDDINGS_SIZE 128
2019-11-13 00:50:12,310 INFO TOP_K_WORDS_CONSIDERED_DURING_PREDICTION 10
2019-11-13 00:50:12,310 INFO TRAIN_BATCH_SIZE 1024
2019-11-13 00:50:12,311 INFO TRAIN_DATA_PATH_PREFIX None
2019-11-13 00:50:12,311 INFO USE_TENSORBOARD False
2019-11-13 00:50:12,311 INFO VERBOSE_MODE 1
2019-11-13 00:50:12,311 INFO _Config__logger <Logger code2vec (INFO)>
2019-11-13 00:50:12,311 INFO context_vector_size 384
2019-11-13 00:50:12,312 INFO entire_model_load_path models/java14_model/saved_model_iter8.release__entire-model
2019-11-13 00:50:12,312 INFO entire_model_save_path None
2019-11-13 00:50:12,312 INFO is_loading True
2019-11-13 00:50:12,312 INFO is_saving False
2019-11-13 00:50:12,312 INFO is_testing False
2019-11-13 00:50:12,313 INFO is_training False
2019-11-13 00:50:12,313 INFO model_load_dir models/java14_model
2019-11-13 00:50:12,313 INFO model_weights_load_path models/java14_model/saved_model_iter8.release__only-weights
2019-11-13 00:50:12,313 INFO model_weights_save_path None
2019-11-13 00:50:12,313 INFO test_steps 0
2019-11-13 00:50:12,313 INFO train_data_path None
2019-11-13 00:50:12,313 INFO train_steps_per_epoch 0
2019-11-13 00:50:12,313 INFO word_freq_dict_path None
2019-11-13 00:50:12,313 INFO ---------------------------------------------------------------------
2019-11-13 00:50:12,314 INFO Loading model vocabularies from: models/java14_model/dictionaries.bin ...
2019-11-13 00:50:28,240 INFO Done loading model vocabularies.
2019-11-13 00:50:30,001 INFO Done creating code2vec model
2019-11-13 00:50:38.261557: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1096] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-11-13 00:50:38.261595: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102]
WARNING:tensorflow:From /home/sidekoiii/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1635: calling BaseResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Traceback (most recent call last):
File "code2vec.py", line 36, in
predictor = InteractivePredictor(config, model)
File "/home/sidekoiii/code2vec/interactive_predict.py", line 16, in init
model.predict([])
File "/home/sidekoiii/code2vec/tensorflow_model.py", line 321, in predict
self._build_tf_test_graph(reader_output, normalize_scores=True)
File "/home/sidekoiii/code2vec/tensorflow_model.py", line 287, in _build_tf_test_graph
input_tensors = _TFEvaluateModelInputTensorsFormer().from_model_input_form(input_tensors)
File "/home/sidekoiii/code2vec/tensorflow_model.py", line 528, in from_model_input_form
path_source_token_strings=input_row[5],
IndexError: tuple index out of range

However I can run this command successfully
python3 code2vec.py --load models/java14_model/saved_model_iter8.release --test data/java14m/java14m.test.c2v

@urialon
Copy link
Collaborator

urialon commented Nov 12, 2019

Hi @francefa ,

Edited:
Please check the following, in this order:

  1. which TensorFlow version are you using? (inside python: import tensorflow as tf; tf.__version__)
  2. Do you have JDK installed (java --version)?
  3. Did you change the code or the configuration in any way (git diff)?
  4. Do you have CUDA and CuDNN installed? The error messages hint that there might be a problem with these, but it can also be unrelated.
  5. Can you please check if it works when you check out this commit:
    9789cfa
    ?

@francefa
Copy link
Author

To @urialon
Thank you for your help now I can run the command after I install CUDA 10.0, CuDNN for CUDA 10.0 and Re-install Tensorflow version 2.0 instead of current version.

@urialon urialon closed this as completed Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants