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?
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 fileembeddings.py
is called without the positional argumentkeyed_vector
in filerun.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?