Vul-LMGNN / vul-LMGGNN

Code for the paper - Source Code Vulnerability Detection: Combining Code Language Models and Code Property Graph
Apache License 2.0
31 stars 9 forks source link

The call of function "nodes_to_input" in file run.py missed the positional argument "keyed_vectors". #2

Closed Sillouevan closed 4 months ago

Sillouevan commented 5 months ago

Hello! When I try to follow the command python run.py -cpg -embed -mode train -path ./models/saved to prepare the CPG, one issue occurred as follow: Traceback (most recent call last): File "run.py", line 189, in <module> Embed_generator() File "run.py", line 88, in Embed_generator cpg_dataset["input"] = cpg_dataset.apply(lambda row: process.nodes_to_input(row.nodes, row.target, context.nodes_dim, context.edge_type), axis=1) File "/root/miniconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 9423, in apply return op.apply().__finalize__(self, method="apply") File "/root/miniconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 678, in apply return self.apply_standard() File "/root/miniconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 798, in apply_standard results, res_index = self.apply_series_generator() File "/root/miniconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 814, in apply_series_generator results[i] = self.f(v) File "run.py", line 88, in <lambda> cpg_dataset["input"] = cpg_dataset.apply(lambda row: process.nodes_to_input(row.nodes, row.target, context.nodes_dim, context.edge_type), axis=1) TypeError: nodes_to_input() missing 1 required positional argument: 'edge_type'

Then I noticed that maybe the function nodes_to_input(nodes, target, nodes_dim, keyed_vectors, edge_type) in file embeddings.py is called without the positional argument keyed_vector in file run.py ( cpg_dataset["input"] = cpg_dataset.apply(lambda row: process.nodes_to_input(row.nodes, row.target, context.nodes_dim, context.edge_type), axis=1) line 88 ). I think that's why this problem occurred. Could you please tell me how to fix it? Is there something I missed?

Sillouevan commented 5 months ago

image

Kaiyuan-Zhao commented 2 months ago

How did you fix this? I have the same issue