DanielLin1986 / Function-level-Vulnerability-Detection

A deep learning-based vulnerability detection framework
71 stars 23 forks source link

can't get output : results\models (train the model ) #13

Open aravinthk00 opened 2 years ago

aravinthk00 commented 2 years ago

i run this command (myenv) C:\Users\30863\Function-level-Vulnerability-Detection-master\Function-level-Vulnerability-Detection-master>python main.py --config config\config.yaml --data_dir C:\Users\30863\TotalSource\C --embedding elmo ,process(training ) is automatically terminated . could you help me..

My Log

Using TensorFlow backend. [INFO] Start training process.... [INFO] Loading data from C:\Users\30863\Function-level-Vulnerability-Detection-master\Function-level-Vulnerability-Detection-master\C:\Users\30863\TotalSource\C.... [INFO] The length of the loaded data list is : 3763 [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 2408 total samples in the training set. 2394 vulnerable samples. [INFO] There are 602 total samples in the validation set. 601 vulnerable samples. [INFO] ------------------------------------------------------- 2022-08-02 11:53:41.457219: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 [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.

2022-08-02 11:53:42.445827: W tensorflow/core/graph/graph_constructor.cc:1491] Importing a graph with a lower producer version 26 into an existing graph with producer version 134. Shape inference will have run different parts of the graph with different producer versions. WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:3376: The name tf.log is deprecated. Please use tf.math.log instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:3376: The name tf.log is deprecated. Please use tf.math.log instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\tensorflow_core\python\ops\nn_impl.py:183: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\tensorflow_core\python\ops\nn_impl.py:183: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where


Layer (type) Output Shape Param #

input_1 (InputLayer) (None, None) 0


lambda_1 (Lambda) (None, None, 1024) 0


bidirectional_1 (Bidirection (None, None, 256) 1180672


bidirectional_2 (Bidirection (None, None, 256) 394240


global_max_pooling1d_1 (Glob (None, 256) 0


dropout_1 (Dropout) (None, 256) 0


dense_1 (Dense) (None, 64) 16448


dense_2 (Dense) (None, 1) 65

Total params: 1,591,425 Trainable params: 1,591,425 Non-trainable params: 0


[INFO] Model structure loaded. WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:95: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:95: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.

DanielLin1986 commented 2 years ago

i run this command (myenv) C:\Users\30863\Function-level-Vulnerability-Detection-master\Function-level-Vulnerability-Detection-master>python main.py --config config\config.yaml --data_dir C:\Users\30863\TotalSource\C --embedding elmo ,process(training ) is automatically terminated . could you help me..

My Log

Using TensorFlow backend. [INFO] Start training process.... [INFO] Loading data from C:\Users\30863\Function-level-Vulnerability-Detection-master\Function-level-Vulnerability-Detection-master\C:\Users\30863\TotalSource\C.... [INFO] The length of the loaded data list is : 3763 [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 2408 total samples in the training set. 2394 vulnerable samples. [INFO] There are 602 total samples in the validation set. 601 vulnerable samples. [INFO] ------------------------------------------------------- 2022-08-02 11:53:41.457219: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 [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.

2022-08-02 11:53:42.445827: W tensorflow/core/graph/graph_constructor.cc:1491] Importing a graph with a lower producer version 26 into an existing graph with producer version 134. Shape inference will have run different parts of the graph with different producer versions. WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:3376: The name tf.log is deprecated. Please use tf.math.log instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:3376: The name tf.log is deprecated. Please use tf.math.log instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\tensorflow_core\python\ops\nn_impl.py:183: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\tensorflow_core\python\ops\nn_impl.py:183: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where

Layer (type) Output Shape Param

input_1 (InputLayer) (None, None) 0

lambda_1 (Lambda) (None, None, 1024) 0

bidirectional_1 (Bidirection (None, None, 256) 1180672

bidirectional_2 (Bidirection (None, None, 256) 394240

global_max_pooling1d_1 (Glob (None, 256) 0

dropout_1 (Dropout) (None, 256) 0

dense_1 (Dense) (None, 64) 16448

dense_2 (Dense) (None, 1) 65

Total params: 1,591,425 Trainable params: 1,591,425 Non-trainable params: 0

[INFO] Model structure loaded. WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:95: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.

WARNING:tensorflow:From C:\Users\30863\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py:95: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.

Hi, did it provide any error messages? Based on the logs you provided, it did not show any errors. When I tried it, the model could be saved. image