cancel
Showing results for 
Search instead for 
Did you mean: 

identifier "AI_AI_DATA_ACTIVATION_1_SIZE" is undefined

Sunjing
Associate II

..\..\AI\X-CUBE-AI\App\app_x-cube-ai.c(93):error: #20: identifier "AI_AI_DATA_ACTIVATION_1_SIZE" is undefined
static uint8_t poo10[AI_AI_DATA_ACTIVATION_1_SIZE];

...\...\AI\X-CUBE-AI\App\app_x-cube-ai.c(95): error: #28: expression must have a constant value
ai_handle data_activations0[ ] = {poo10};

 

thank u!!!!!!!!

9 REPLIES 9

Have you done a search to see if any definition of "AI_AI_DATA_ACTIVATION_1_SIZE" does exist anywhere?

 

yes,

微信图片_20240319230123.png

''AI_AI_DATA_ACTIVATION_1_SIZE'' , It only exists in ‘’app_x-cube-ai.c‘’ this file, there is no definition,

and there have two files in lib

微信图片_20240319230117.png

 

when I use sklearn-onnx generate a file

 

initial_type = [('float_input', FloatTensorType([1, 270]))]
model_onnx = convert_sklearn(clf, initial_types=initial_type)
with open("adaboost-270-1.onnx", "wb") as f:
f.write(model_onnx.SerializeToString())

I'm not sure if it's because of this place bug:initial_type = [('float_input', FloatTensorType([1, 270]))]

fauvarque.daniel
ST Employee

The correct constant is probably AI_DATA_ACTIVATION_1_SIZE

I don't know why you have twice AI_


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

..\..\AI\X-CUBE-AI\App\app_x-cube-ai.c(93):error: #20: identifier "AI_AI_DATA_ACTIVATION_1_SIZE" is undefined
static uint8_t poo10[AI_AI_DATA_ACTIVATION_1_SIZE];

...\...\AI\X-CUBE-AI\App\app_x-cube-ai.c(95): error: #28: expression must have a constant value
ai_handle data_activations0[ ] = {poo10};

 

but I don't know how to fix this issue

fauvarque.daniel
ST Employee

Correction, you probably named your network AI that's why the constant is like that 

 

it is defined in the network_data_params.h file (or ai_data_params.h probably in your case)


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

The second error:

...\...\AI\X-CUBE-AI\App\app_x-cube-ai.c(95): error: #28: expression must have a constant value
ai_handle data_activations0[ ] = {poo10};

Is clearly a result of the first error:

..\..\AI\X-CUBE-AI\App\app_x-cube-ai.c(93):error: #20: identifier "AI_AI_DATA_ACTIVATION_1_SIZE" is undefined
static uint8_t poo10[AI_AI_DATA_ACTIVATION_1_SIZE];

 

The first error causes your definition of poo10 to be invalid - therefore you get the 2nd error when you try to use poo10.

Thus one fix will solve both errors.

I didn't find this in file

global search didn't find anything
This parameter is only present at the invocation point and has not been defined, which is why it is reported

when I use sklearn-onnx generate a file

initial_type = [('float_input', FloatTensorType([1, 270]))]
model_onnx = convert_sklearn(clf, initial_types=initial_type)
with open("adaboost-270-1.onnx", "wb") as f:
    f.write(model_onnx.SerializeToString())

The first time I used the following code

 initial_type = [('float_input', FloatTensorType([None, 2]))] 

can success, but the input data for the algorithm model is 1x270

so I changed the code to

initial_type = [('float_input', FloatTensorType([1, 270]))]

but when I use this code.

This problem has occurred

【..\..\AI\X-CUBE-AI\App\app_x-cube-ai.c(93):error: #20: identifier "AI_AI_DATA_ACTIVATION_1_SIZE" is undefined
static uint8_t poo10[AI_AI_DATA_ACTIVATION_1_SIZE];

...\...\AI\X-CUBE-AI\App\app_x-cube-ai.c(95): error: #28: expression must have a constant value
ai_handle data_activations0[ ] = {poo10};】

Is there an error generating the [.onnx] model file

 

global search didn't find anything
This parameter is only present at the invocation point and has not been defined, which is why it is reported

when I use sklearn-onnx generate a file

initial_type = [('float_input', FloatTensorType([1, 270]))]
model_onnx = convert_sklearn(clf, initial_types=initial_type)
with open("adaboost-270-1.onnx", "wb") as f:
    f.write(model_onnx.SerializeToString())

 

 

 

The first time I used the following code

initial_type = [('float_input', FloatTensorType([None, 2]))] 

can success, but the input data for the algorithm model is 1x270

 

 

so I changed the code to

initial_type = [('float_input', FloatTensorType([1, 270]))]

but when I use this code.

 

This problem has occurred

..\..\AI\X-CUBE-AI\App\app_x-cube-ai.c(93):error: #20: identifier "AI_AI_DATA_ACTIVATION_1_SIZE" is undefined
static uint8_t poo10[AI_AI_DATA_ACTIVATION_1_SIZE];

 

Is there an error generating the [.onnx] model file