DanielLin1986 / Function-level-Vulnerability-Detection

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

tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: #17

Open aravinthk00 opened 2 years ago

aravinthk00 commented 2 years ago

I try to train and obtain high-level representation on the model when I getting same error log :

(pythonProject1) C:\Users\30863\Func-level-vul-detect>Python main.py --config config\config.yaml --data_dir C:\Users\30863\Func-level-vul-detect\data --embedding ELMo Using TensorFlow backend. 2022-08-09 14:15:53.451951: 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-09 14:15:53.452130: 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\Func-level-vul-detect\C:\Users\30863\Func-level-vul-detect\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-09 14:15:55.883333: 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-09 14:15:55.887998: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found 2022-08-09 14:15:55.888066: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303) 2022-08-09 14:15:55.892895: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: 30863-436055 2022-08-09 14:15:55.893079: 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\pythonProject1\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\pythonProject1\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 helper.exec() File "C:\Users\30863\Func-level-vul-detect\src\helper.py", line 253, in exec model_func = elmo_network.build_elmo_network(GPU_flag) File "C:\Users\30863\Func-level-vul-detect\src\models\elmo_network.py", line 43, in build_elmo_network elmo_embedding = Lambda(self.make_elmo_embedding, output_shape=(None, 1024))(elmo_input) File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\keras\engine\base_layer.py", line 457, in call output = self.call(inputs, kwargs) File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\keras\layers\core.py", line 687, in call return self.function(inputs, arguments) File "C:\Users\30863\Func-level-vul-detect\src\models\elmo_network.py", line 35, in make_elmo_embedding elmo_model = hub.Module("https://tfhub.dev/google/elmo/2", trainable=True) File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\tensorflow_hub\module.py", line 157, in init self._spec = as_module_spec(spec) File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\tensorflow_hub\module.py", line 30, in as_module_spec return load_module_spec(spec) File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\tensorflow_hub\module.py", line 65, in load_module_spec return registry.loader(path) File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\tensorflow_hub\registry.py", line 51, in call return impl(*args, *kwargs) File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\tensorflow_hub\native_module.py", line 139, in call module_def_proto = self._get_module_def_proto(path) File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\tensorflow_hub\native_module.py", line 130, in _get_module_def_proto module_def_proto.ParseFromString(f.read()) File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\tensorflow_core\python\lib\io\file_io.py", line 122, in read self._preread_check() File "C:\Users\30863\Anaconda3\envs\pythonProject1\lib\site-packages\tensorflow_core\python\lib\io\file_io.py", line 84, in _preread_check compat.as_bytes(self.__name), 1024 512) tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: C:\Users\30863\AppData\Local\Temp\tfhub_modules\9bb74bc86f9caffc8c47dd7b33ec4bb354d9602d\tfhub_module.pb : The system cannot find the file specified. ; No such file or directory

Anyone tell me why this error raised and solution ? I didn't get any idea about this sorry for the intreput and silly questions , i am small boy on this field .. advance thanks

DanielLin1986 commented 2 years ago

Please check whether the ELMo module has been downloaded successfully. The following messages you provided:

"tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: C:\Users\30863\AppData\Local\Temp\tfhub_modules\9bb74bc86f9caffc8c47dd7b33ec4bb354d9602d\tfhub_module.pb : The system cannot find the file specified. ; No such file or directory"

seem to say that the model was not downloaded. So, the model file cannot be found.