2025-03-23 8:59 AM - edited 2025-03-23 10:11 AM
Hi everyone,
I'm trying to perform a validation test on an STM32H747I-DISCO, but I haven't been able to get it working.
Here's what I'm doing:
#
# AI Validation 7.1
#
Compiled with GCC 13.3.1
STM32 device configuration...
Device : DevID:0x0450 (STM32H743/53/50xx and STM32H745/55/47/57xx) RevID:0x2003
Core Arch. : M7 - FPU used
HAL version : 0x010b0500
SYSCLK clock : 400 MHz
HCLK clock : 200 MHz
FLASH conf. : ACR=0x00000032 - latency=2
CACHE conf. : $I/$D=(True,True)
Timestamp : SysTick + DWT (delay(1)=1.002 ms)
ST.AI RT
--------------------------------------------------
tools version : v2.0.0
network rt lib : v10.0.0-fd22b7f9
compiled with : GCC 11.3.1
Discovering the network(s)...
Found network "network"
Creating the network "network"..
Initializing the network
Network informations...
model name : network
model signature : 0x8f1b6d2aab7b9895e6460ef525012bb0
model datetime : 2025-03-23T17:34:47+0100
compile datetime : Mar 23 2025 17:35:55
tools version : 2.0.0
complexity : 8200 MACC
c-nodes : 4
map_activations : 1
[0] @0x20000000/1152
map_weights : 1
[0] @0x8010860/2896
n_inputs/n_outputs : 1/1
I[0] (1,8,8,2)128/i8 1:(0.003921,-128), @0x20000400/128
O[0] (1,1,1,8)8/i8 1:(0.003906,-128), @0x200003E8/8
-------------------------------------------
| READY to receive a CMD from the HOST... |
-------------------------------------------
# Note: At this point, default ASCII-base terminal should be closed
# and a serial COM interface should be used
# (i.e. Python ai_runner module). Protocol version = 3.1
I tried to send random data (in the shape expected from the network) using python Serial and then reading them through picocom. In that case I can see unknow characters as the bytes are converted in ASCII. So, I suppose that the network gives some output...
Any suggestions on how to fix it?
Thanks in advance!
2025-03-24 6:50 AM
Hello @Dresult ,
Thank you for your message.
I have seen it one or two times, but I never got to have the user model to test it out.
I don't have a H7 with me today, I will test it out tomorrow.
I'll update you when I know more
Have a good day,
Julian
2025-03-24 7:48 AM - edited 2025-03-24 7:49 AM
Hi Julian,
thanks a lot! Let me know if you need more information or if I can help in someway.
Looking forward to your update, have a good day too!
2025-03-27 1:47 AM
Hello @Dresult ,
There is indeed a timeout error when using the .ioc from the dev cloud. It may be because of the memory pool settings. I am still investigating this.
In the meantime, if you really need to do a validation on target, you just need to create a new CubeMX project, set everything by default, activate X Cube AI with the validation template. Generally, CubeMX ask if to set the optimal parameter after that, I generally click no. Then you import the model, click validate on target, check the option to flash the code and select STM32CubeIDE.
Have a good day,
Julian
2025-03-27 3:20 AM - edited 2025-03-27 4:05 AM
Hi Julian,
Thanks a lot for your time! I tried your solution, and now the validation works as expected. Please let me know if you find a solution for the .ioc file generated from the dev cloud :)
@Julian E. I have a question related to validation but not directly correlated to this issue...
I'm trying to deploy a model on the boards of the dev cloud, the initial layers are these:
however, when it comes to the quantization steps if I add an npz file for validation I receive this error:
[ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Invalid rank for input: input Got: 2 Expected: 3 Please fix either the inputs or the model.
the file in this case is generated with this code and resambles real inputs with a dimension for x of 1x4096x1 and y that is a 1x1.
import numpy as np
x_test = np.random.rand(1, 4096, 1).astype(np.float32)
y_test = np.random.rand(1, 1).astype(np.float32)
np.savez("test_data.npz", x_test=x_test, y_test=y_test)
It seems like if the validation tool internally performs a squeeze. Have you ever encountered this problem ?
2025-03-27 6:30 AM - edited 2025-03-27 6:30 AM
Hello @Dresult ,
Can you send the model, I think that if you do a stedgeai generate, it is written somewhere, I would like to verify that.
Can you try to generate (batch_size,1,4096,1) and (batch_size,1,1)?
For example:
import numpy as np
x_test = np.random.rand(10,1, 4096, 1).astype(np.float32)
y_test = np.random.rand(10,1, 1).astype(np.float32)
np.savez("test_data.npz", x_test=x_test, y_test=y_test)
It is similar to this question: Solved: Error in Post-Training Quantization: 'Axis 2 is ou... - STMicroelectronics Community
I will need your model to know for sure.
Also the part about the idea that quantizing a small model can make it better may interest you
Have a good day,
Julian
2025-03-27 8:32 AM
Thank you very much! With this input shape it works perfectly, however I don't understand, I thought the first dimension was the batch size...