DanielLin1986 / Function-level-Vulnerability-Detection

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

Lambda Layer issue #10

Open lab-pc opened 2 years ago

lab-pc commented 2 years ago
    "name_scope was already taken." % abs_state_scope)

RuntimeError: Exception encountered when calling layer "lambda" (type Lambda).

variable_scope module_1/ was unused but the corresponding name_scope was already taken.

Call arguments received by layer "lambda" (type Lambda):
  • inputs=tf.Tensor(shape=(None, 1), dtype=string)
  • mask=None
  • training=True
Zaibali9999 commented 2 years ago

fn = module_objects.get(function_name) AttributeError: 'NoneType' object has no attribute 'get

Zaibali9999 commented 2 years ago

Issue Everything works fine if you define the custom_layer not as a class method, but as a separate function, either within the class method or outside of it. The unexpected behaviour occurs only when this custom_layer is defined as a class method.

Zaibali9999 commented 2 years ago

trained_model = load_model(trained_model_path, custom_objects={'make_elmo_embedding': self.make_elmo_embedding})

keras==2.2.5 h5py==2.10.0

Zaibali9999 commented 2 years ago

probs = model.predict(test_set_x, batch_size = self.config['training_settings']['network_config']['batch_size'], verbose = self.paras.verbose) run_metadata_ptr) tensorflow.python.framework.errors_impl.InternalError: Unsupported object type int

lihuiuyun commented 2 years ago

I have the same problem,have you slove it?

DanielLin1986 commented 2 years ago

fn = module_objects.get(function_name) AttributeError: 'NoneType' object has no attribute 'get

The bug has been fixed. Please try it again using the latest code.

DanielLin1986 commented 2 years ago

I have the same problem,have you slove it?

The bug has been fixed. Please try again by pulling the latest version of the code.

DanielLin1986 commented 2 years ago

probs = model.predict(test_set_x, batch_size = self.config['training_settings']['network_config']['batch_size'], verbose = self.paras.verbose) run_metadata_ptr) tensorflow.python.framework.errors_impl.InternalError: Unsupported object type int

Please run the code using Tensorflow 1.15 and Keras 2.3.1.

aravinthk00 commented 2 years ago

I also encounter same issue but tried latest version of code but not yet it is not fixed.