2025-04-10 7:44 AM
Hi everyone,
I'm trying to run inference with a TFLite model on a Nucleo-N657X0-Q board.
The issue I'm facing is that the network returns a constant output for constant inputs - but the value of this constant changes each time I restart the application. When the input varies, the output also varies, but the values returned are not consistent with those obtained during the validation process.
The model was quantized using a post-training quantization approach.
I'm using AXISRAM4 and AXISRAM5, which have been correctly initialized and enabled in the main.c.
I attach the .ioc file, the app_x-cube-ai.c file and the quantized tflite model for reference.
Thanks in advance for any suggestions!
2025-04-10 9:25 AM
Hello @LisaB,
Did you used any argument/option other than the default one in X cube AI?
At first glance, it looks like a cache issue.
Have a good day,
Julian
2025-04-10 10:29 AM
Hi @Julian E.,
thanks for your reply!
As you can see in the attached picture I used the default options for X cube AI.
I thought about a cache problem too, for this reason i added the command
SCB_CleanInvalidateDCache_by_Addr(buffer_in, nn_in_len)
before the network initialization and the command
SCB_InvalidateDCache_by_Addr(buffer_out, nn_out_len)
after the network inference, but I was not able to solve the problem (you can find this in the file app_x-cube-ai.c previously attached).
2025-04-11 1:24 AM
Hello @LisaB ,
Can you copy/paste the "Extra Neural Art option", I don't think I can see them all in the screenshot.
Did you used the --cache-maintenance option?
Have a good day,
Julian
2025-04-11 1:27 AM
Hi @Julian E.,
these are the options:
--all-buffers-info --mvei --no-hw-sw-parallelism --cache-maintenance --Oalt-sched --native-float --enable-virtual-mem-pools --Omax-ca-pipe 4 --Oshuffle-dma --Ocache-opt.
I didn't change anything, they are the default ones.
2025-04-11 7:42 AM
Hello @LisaB,
Can you share your whole project in a .zip file please.
We don't see anything wrong.
Have a good day,
Julian
2025-04-11 9:42 AM - edited 2025-04-11 9:48 AM
Hi @Julian E.,
I attach the whole project.
If I insert a breakpoint at the row 142 of the file app_x-cube-ai.c, each time I restart the debug session the value pointed by buffer_out (quantized value returned by the first output neuron after the inference) changes.
Many thanks for the interest expressed in my topic.
Lisa