2025-06-06 9:25 AM
Hi - I'm attempting to run my first NN on an STM32H5. This is a low frame rate, low resolution vision application.
When loading NN into CubeMX, the Analyze results and graph are always the same - just the final dense layer. In case it matters, I train the network using tensorflow/keras and have tried multiple variations with similar results. Also, I have updated all tools and libraries within the last few weeks.
Below is my network_generated_report.txt. It shows the param/size and macc for all layers but the summary is just the final layer.
Why might this be and how do I get the complete results? Perhaps I am deeply misunderstanding something!
ST Edge AI Core v2.1.0-20194 329b0e98d
Created date : 2025-06-05 12:55:47
Parameters : generate --target stm32h5 --name network -m C:/AI/line_intensity_model.h5 --compression none --verbosity 1 --workspace C:/Users/me/AppData/Local/Temp/mxAI_workspace1431250019060016128019384163178723 --output C:/Users/me/.stm32cubemx/network_output
Exec/report summary (generate)
---------------------------------------------------------------------------------------------------------------
model file : C:\AI\line_intensity_model.h5
type : keras
c_name : network
compression : none
options : allocate-inputs, allocate-outputs
optimization : balanced
target/series : stm32h5
workspace dir : C:\Users\me\AppData\Local\Temp\mxAI_workspace1431250019060016128019384163178723
output dir : C:\Users\me\.stm32cubemx\network_output
model_fmt : float
model_name : line_intensity_model
model_hash : 0xb124f1a71b6e4dc396d0dc1318a94841
params # : 69,505 items (271.50 KiB)
---------------------------------------------------------------------------------------------------------------
input 1/1 : 'input_0', f32(1x24x24x2), 4.50 KBytes, activations
output 1/1 : 'dense_17', f32(1x1), 4 Bytes, activations
macc : 25
weights (ro) : 100 B (100 B) (1 segment) / -277,920(-100.0%) vs float model
activations (rw) : 4,708 B (4.60 KiB) (1 segment) *
ram (total) : 4,708 B (4.60 KiB) = 4,708 + 0 + 0
---------------------------------------------------------------------------------------------------------------
(*) 'input'/'output' buffers can be used from the activations buffer
Model name - line_intensity_model
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
m_id layer (type,original) oshape param/size macc connected to | c_size c_macc c_type
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
0 input_0 (Input, None) [b:1,h:24,w:24,c:2] |
conv2d_10_conv2d (Conv2D, Conv2D) [b:1,h:22,w:22,c:32] 608/2,432 278,816 input_0 | -2,432(-100.0%) -278,816(-100.0%)
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
1 input_1 (Input, None) [b:1,h:22,w:22,c:32] |
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
2 input_2 (Input, None) [b:1,h:22,w:22,c:32] |
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
3 input_3 (Input, None) [b:1,h:11,w:11,c:32] |
conv2d_11_conv2d (Conv2D, Conv2D) [b:1,h:9,w:9,c:64] 18,496/73,984 1,493,056 input_3 | -73,984(-100.0%) -1,493,056(-100.0%)
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
4 input_4 (Input, None) [b:1,h:9,w:9,c:64] |
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
5 input_5 (Input, None) [b:1,h:9,w:9,c:64] |
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
6 input_6 (Input, None) [b:1,h:4,w:4,c:64] |
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
7 input_7 (Input, None) [b:1,c:1024] |
dense_15_dense (Dense, Dense) [b:1,c:48] 49,200/196,800 49,200 input_7 | -196,800(-100.0%) -49,200(-100.0%)
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
8 input_8 (Input, None) [b:1,c:48] |
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
9 input_9 (Input, None) [b:1,c:48] |
dense_16_dense (Dense, Dense) [b:1,c:24] 1,176/4,704 1,176 input_9 | -4,704(-100.0%) -1,176(-100.0%)
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
10 input_10 (Input, None) [b:1,c:24] |
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
11 input_11 (Input, None) [b:1,c:24] | +100(+100.0%) +25(+100.0%) Dense_[o][0]
dense_17 (Dense, Dense) [b:1,c:1] 25/100 25 input_11 | -100(-100.0%) -25(-100.0%)
------ ----------------------------------- ---------------------- ---------------- ----------- -------------- --- ------------------- --------------------- --------------
model/c-model: macc=1,822,273/25 -1,822,248(-100.0%) weights=278,020/100 -277,920(-100.0%) activations=--/4,708 io=--/0
Generated C-graph summary
------------------------------------------------------------------------------------------------------------------------
model name : line_intensity_model
c-name : network
c-node # : 1
c-array # : 5
activations size : 4708 (1 segment)
weights size : 100 (1 segment)
macc : 25
inputs : ['input_0_output']
outputs : ['dense_17_output']
C-Arrays (5)
------ ------------------ ----------- ------------------------- ------------- ---------
c_id name (*_array) item/size domain/mem-pool c-type comment
------ ------------------ ----------- ------------------------- ------------- ---------
0 dense_17_bias 1/4 weights/weights const float
1 dense_17_output 1/4 activations/**default** float /output
2 dense_17_weights 24/96 weights/weights const float
3 input_0_output 1152/4608 activations/**default** float /input
4 input_11_output 24/96 activations/**default** float
------ ------------------ ----------- ------------------------- ------------- ---------
C-Layers (1)
------ ---------------- ---- ------------ ------ ----- --------------------- ------------------
c_id name (*_layer) id layer_type macc rom tensors shape (array id)
------ ---------------- ---- ------------ ------ ----- --------------------- ------------------
0 dense_17 11 Dense 25 100 I: input_11_output f32(1x24) (4)
W: dense_17_weights f32(1x24) (2)
W: dense_17_bias f32(1) (0)
O: dense_17_output f32(1x1) (1)
------ ---------------- ---- ------------ ------ ----- --------------------- ------------------
Number of operations per c-layer
------- ------ ------------------ ----- --------------
c_id m_id name (type) #op type
------- ------ ------------------ ----- --------------
0 11 dense_17 (Dense) 25 smul_f32_f32
------- ------ ------------------ ----- --------------
total 25
Number of operation types
---------------- ---- -----------
operation type # %
---------------- ---- -----------
smul_f32_f32 25 100.0%
Complexity report (model)
------ ---------- ------------------------- ------------------------- ------
m_id name c_macc c_rom c_id
------ ---------- ------------------------- ------------------------- ------
11 input_11 |||||||||||||||| 100.0% |||||||||||||||| 100.0% [0]
------ ---------- ------------------------- ------------------------- ------
macc=25 weights=100 act=4,708 ram_io=0
Requested memory size by section - "stm32h5" target
------------------------------- ------- -------- ------ -------
module text rodata data bss
------------------------------- ------- -------- ------ -------
NetworkRuntime1010_CM33_GCC.a 5,900 0 0 0
network.o 408 8 692 116
network_data.o 48 16 88 0
lib (toolchain)* 0 0 0 0
------------------------------- ------- -------- ------ -------
RT total** 6,356 24 780 116
------------------------------- ------- -------- ------ -------
weights 0 104 0 0
activations 0 0 0 4,708
io 0 0 0 0
------------------------------- ------- -------- ------ -------
TOTAL 6,356 128 780 4,824
------------------------------- ------- -------- ------ -------
* toolchain objects (libm/libgcc*)
** RT AI runtime objects (kernels+infrastructure)
Summary - "stm32h5" target
---------------------------------------------------
FLASH (ro) %* RAM (rw) %
---------------------------------------------------
RT total 7,160 98.6% 896 16.0%
---------------------------------------------------
TOTAL 7,264 5,604
---------------------------------------------------
* rt/total
Generated files (7)
---------------------------------------------------------------------
C:\Users\me\.stm32cubemx\network_output\network_data_params.h
C:\Users\me\.stm32cubemx\network_output\network_data_params.c
C:\Users\me\.stm32cubemx\network_output\network_data.h
C:\Users\me\.stm32cubemx\network_output\network_data.c
C:\Users\me\.stm32cubemx\network_output\network_config.h
C:\Users\me\.stm32cubemx\network_output\network.h
C:\Users\me\.stm32cubemx\network_output\network.c