2024-03-19 07:48 AM
..\..\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!!!!!!!!
2024-03-19 07:51 AM
Have you done a search to see if any definition of "AI_AI_DATA_ACTIVATION_1_SIZE" does exist anywhere?
2024-03-19 08:04 AM
yes,
''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
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]))]
2024-03-19 08:06 AM
The correct constant is probably AI_DATA_ACTIVATION_1_SIZE
I don't know why you have twice AI_
2024-03-19 08:32 AM
..\..\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
2024-03-19 08:38 AM
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)
2024-03-19 08:51 AM
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.
2024-03-19 09:11 AM
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};】
2024-03-19 09:13 AM
Is there an error generating the [.onnx] model file
2024-03-19 10:23 AM - edited 2024-03-19 10:26 AM
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