cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with inference using NUCLEO-N657X0-Q

LisaB
Associate

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!

6 REPLIES 6
Julian E.
ST Employee

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


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.

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).

Julian E.
ST Employee

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


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.

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. 

 

Julian E.
ST Employee

Hello @LisaB,

Can you share your whole project in a .zip file please.

We don't see anything wrong.

 

Have a good day,

Julian


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.

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