Open aravinthk00 opened 2 years ago
****This my error when I try to test the model , please give me solution and guidelines
(myenv) C:\Users\30863\Function-level-Vulnerability-Detection-master>python main.py --config config\config.yaml --test --trained_model C:\Users\30863\Function-level-Vulnerability-Detection-master\result\models\test_model_01_0.920_0.334828.h5 Using TensorFlow backend. 2022-08-04 16:53:45.929112: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found 2022-08-04 16:53:45.929253: 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. [INFO] Start testing process.... [INFO] Loading data from C:\Users\30863\Function-level-Vulnerability-Detection-master\data/.... [INFO] The length of the loaded data list is : 622 [INFO] Pad the sequence to unified length... [INFO] Patition the data .... [INFO] There are 125 total samples in the test set. 9 vulnerable samples. Traceback (most recent call last): File "main.py", line 34, in helper.exec() File "C:\Users\30863\Function-level-Vulnerability-Detection-master\src\helper.py", line 346, in exec test_set_x, test_set_y, test_set_id = self.loadTestSet() File "C:\Users\30863\Function-level-Vulnerability-Detection-master\src\helper.py", line 332, in loadTestSet return test_set_x, test_set_y, test_list_id UnboundLocalError: local variable 'test_list_id' referenced before assignment
This error has been fixed, please try it again. Thanks.
For the ELMo, if you want to perform testing, please do it when the model is just finished training.
If you save the trained model in a directory, then load it, and perform the test, the model would not be able to be loaded. Please kindly let me know if you can find a way to load the model.
I used latest helper.py but error not fix and I get same error log
when I use to latest helper.py in train the model , I getting tensorflow.python.framework.errors_impl.NotFoundError
(myenv) C:\Users\30863\Function-level-Vulnerability-Detection-master>Python main.py --config config\config.yaml --data_dir C:\Users\30863\Function-level-Vulnerability-Detection-master\data --embedding ELMo Using TensorFlow backend. 2022-08-08 21:44:41.499118: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found 2022-08-08 21:44:41.499235: 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. [INFO] Start training process.... [INFO] Loading data from C:\Users\30863\Function-level-Vulnerability-Detection-master\C:\Users\30863\Function-level-Vulnerability-Detection-master\data.... [INFO] The length of the loaded data list is : 622 [INFO] Applying ELMo model! [INFO] Setting padding length 1000 for ELMo model. Each textual sequence contains 1000 elements. [INFO] Patition the data .... [INFO] Data processing completed! [INFO] ------------------------------------------------------- [INFO] There are 397 total samples in the training set. 28 vulnerable samples. [INFO] There are 100 total samples in the validation set. 8 vulnerable samples. [INFO] ------------------------------------------------------- 2022-08-08 21:44:44.409825: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2022-08-08 21:44:44.422662: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found 2022-08-08 21:44:44.422872: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303) 2022-08-08 21:44:44.433014: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: 30863-436055 2022-08-08 21:44:44.433328: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: 30863-436055 [INFO] No GPU detected. [INFO] Using CPU for training. It may take considerable time! [INFO] Loading the elmo model. WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.
WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
Traceback (most recent call last):
File "main.py", line 34, in
****This my error when I try to test the model , please give me solution and guidelines
(myenv) C:\Users\30863\Function-level-Vulnerability-Detection-master>python main.py --config config\config.yaml --test --trained_model C:\Users\30863\Function-level-Vulnerability-Detection-master\result\models\test_model_01_0.920_0.334828.h5 Using TensorFlow backend. 2022-08-04 16:53:45.929112: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found 2022-08-04 16:53:45.929253: 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. [INFO] Start testing process.... [INFO] Loading data from C:\Users\30863\Function-level-Vulnerability-Detection-master\data/.... [INFO] The length of the loaded data list is : 622 [INFO] Pad the sequence to unified length... [INFO] Patition the data .... [INFO] There are 125 total samples in the test set. 9 vulnerable samples. Traceback (most recent call last): File "main.py", line 34, in
helper.exec()
File "C:\Users\30863\Function-level-Vulnerability-Detection-master\src\helper.py", line 346, in exec
test_set_x, test_set_y, test_set_id = self.loadTestSet()
File "C:\Users\30863\Function-level-Vulnerability-Detection-master\src\helper.py", line 332, in loadTestSet
return test_set_x, test_set_y, test_list_id
UnboundLocalError: local variable 'test_list_id' referenced before assignment