2021-09-09 09:01 PM
When trying to use ai_network_ai_params, I get this error during the build process(my model name is sine_model). How do you fix this?
Build error message:
../Middlewares/ST/AI/Inc/ai_platform.h:323:4: error: 'union <anonymous>' has no member named 'format'
323 | { .format = (ai_buffer_format)(format_),\
| ^~~~~~
../X-CUBE-AI/App/sine_model_data.h:46:3: note: in expansion of macro 'AI_BUFFER_OBJ_INIT'
46 | AI_BUFFER_OBJ_INIT( \
| ^~~~~~~~~~~~~~~~~~
../Core/Src/main.c:121:5: note: in expansion of macro 'AI_SINE_MODEL_DATA_WEIGHTS'
121 | AI_SINE_MODEL_DATA_WEIGHTS(ai_sine_model_data_weights_get()),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../Middlewares/ST/AI/Inc/ai_platform.h:324:4: error: 'union <anonymous>' has no member named 'n_batches'
324 | .n_batches = (n_batches_), \
| ^~~~~~~~~
../X-CUBE-AI/App/sine_model_data.h:46:3: note: in expansion of macro 'AI_BUFFER_OBJ_INIT'
46 | AI_BUFFER_OBJ_INIT( \
| ^~~~~~~~~~~~~~~~~~
../Core/Src/main.c:121:5: note: in expansion of macro 'AI_SINE_MODEL_DATA_WEIGHTS'
121 | AI_SINE_MODEL_DATA_WEIGHTS(ai_sine_model_data_weights_get()),
code that calls it:
main.c:
// Set working memory and get weights/biases from model
ai_network_params ai_params = {
AI_SINE_MODEL_DATA_WEIGHTS(ai_sine_model_data_weights_get()),
AI_SINE_MODEL_DATA_ACTIVATIONS(activations)
};
sine_model_data.h:
#define AI_SINE_MODEL_DATA_ACTIVATIONS(ptr_) \
AI_BUFFER_OBJ_INIT( \
AI_BUFFER_FORMAT_U8, \
AI_SINE_MODEL_DATA_ACTIVATIONS_COUNT, 1, AI_SINE_MODEL_DATA_ACTIVATIONS_SIZE, 1, \
AI_HANDLE_PTR(ptr_) )
ai_platform.h:
#define AI_BUFFER_OBJ_INIT(format_, h_, w_, ch_, n_batches_, data_) \
{ .format = (ai_buffer_format)(format_),\
.n_batches = (n_batches_), \
.height = (h_), \
.width = (w_), \
.channels = (ch_), \
.data = (ai_handle)(data_), \
.meta_info = NULL \
}
X-Cube-AI version: 7.0.0
STM32CubeIDE version: 1.7.0
board: B-L475E-IOT01A2 (STM32L475VGT6 MCU)
2021-09-24 03:07 AM
I have the same problem, did anyone found a solution?
2021-10-22 05:56 AM
I still have the same issue, did anyone find a solution so far?
2021-10-25 05:47 AM
TEMPORARY Workaround: Downgrade X-Cube-AI package to version 5.2.0
--> Errors were resolved.
However, a solution for the current version 7.0.0 would be very much appreciated!
2021-10-28 04:46 PM
ai_network_params ai_params = {AI_SINE_MODEL_DATA_WEIGHTS(ai_sine_model_data_weights_get()), AI_SINE_MODEL_DATA_ACTIVATIONS(activations)};
to
ai_network_params ai_params = AI_NETWORK_PARAMS_INIT(AI_SINE_MODEL_DATA_WEIGHTS(ai_sine_model_data_weights_get()), AI_SINE_MODEL_DATA_ACTIVATIONS(activations));
Because you use the initialization of ver 5.2.0 instead of version 7.0.0
2021-10-30 10:54 PM
I installed the version 5.2.0 and made the firmware of Openmv Camera again, but I have the same error as before. So, there must be another problem, not the version as you said.
2021-10-31 12:08 AM
Thank you so much.
Now, I know what the problem was. I used this version X-CUBE-AI.6.0.0 and after that I added the STM32Cube.AI library to OpenMV, what I forgot to do. So, that was my problem. That was my fault and I didn’t do the following step:
1.4 Step 2 - Add the STM32Cube.AI library to OpenMV
Thank you very much for your help, again. But there is no need to use this version 5.2.0.
2021-10-31 12:12 AM
I explain what I've done, then you can do it for your project as you need, if your project is a little bit different.
Now, I know what the problem was. I used this version X-CUBE-AI.6.0.0 and after that I added the STM32Cube.AI library to OpenMV, what I forgot to do. So, that was my problem. That was my fault and I didn’t do the following step:
1.4 Step 2 - Add the STM32Cube.AI library to OpenMV
But there is no need to use this version 5.2.0.