Undefined dataformat in exporting model to STM32
What commit version of aidge do you use
-
aidge_core
: 0.5.0 -
aidge_export_arm_cortexm
: 0.1.0
Problem description
I would like to export my trained autoencoder to STM32. The input propagated forward the network is a vector of 20 elements. My python script is given below and you can find as attached my trained model. nf_ae.onnx
import aidge_core
import aidge_backend_cpu
import aidge_onnx
import aidge_export_cpp
import aidge_export_arm_cortexm
# Load the model in AIDGE
my_model = aidge_onnx.load_onnx("nf_ae.onnx")
# Check if my model is supported by AIDGE
if not aidge_onnx.has_native_coverage(my_model):
print("The graph is not fully supported by Aidge !\n")
aidge_onnx.native_coverage_report(my_model)
# Configuration for the model + forward dimensions
my_model.compile("cpu", aidge_core.dtype.float32, dims=[[1, 20]])
# Generate scheduling of the model
scheduler = aidge_core.SequentialScheduler(my_model)
scheduler.generate_scheduling()
# Export the model
aidge_core.export_utils.scheduler_export(
scheduler,
"lenet_export_fp32",
aidge_export_arm_cortexm.ExportLibAidgeARM,
memory_manager=aidge_core.mem_info.generate_optimized_memory_info,
memory_manager_args={"stats_folder": "lenet_export_fp32/stats", "wrapping": False }
)
aidge_export_arm_cortexm.gen_board_files("lenet_export_fp32", "stm32h7")
When I execute the script, the terminal returns the error below :
---------------------------------------------------------------------------
UndefinedError Traceback (most recent call last)
Cell In[7], line 2
1 # Export the model
----> 2 aidge_core.export_utils.scheduler_export(
3 scheduler,
4 "lenet_export_fp32",
5 aidge_export_arm_cortexm.ExportLibAidgeARM,
6 memory_manager=aidge_core.mem_info.generate_optimized_memory_info,
7 memory_manager_args={"stats_folder": "lenet_export_fp32/stats", "wrapping": False }
8 )
10 aidge_export_arm_cortexm.gen_board_files("lenet_export_fp32", "stm32h7")
File c:\Users\Mission\aidge1\env_aidge\Lib\site-packages\aidge_core\export_utils\scheduler_export.py:139, in scheduler_export(scheduler, export_folder_path, export_lib, memory_manager, memory_manager_args, test_mode)
137 list_configs += op.export(dnn_folder)
138 # For forward file
--> 139 list_actions += op.forward()
140 if is_input:
141 for idx, node_in in enumerate(node.inputs()):
File c:\Users\Mission\aidge1\env_aidge\Lib\site-packages\aidge_core\export_utils\node_export.py:450, in ExportNodeCpp.forward(self)
448 if self.forward_template is None:
449 raise ValueError("forward_template have not been defined")
--> 450 forward_call: str = code_generation.generate_str(
451 self.forward_template,
...
File ~\aidge1\env_aidge\Lib\site-packages\aidge_export_arm_cortexm\_Aidge_Arm\templates\forward_call\matmul.jinja:1, in top-level template code()
----> 1 aidge_matmul_chw_{{dataformat}} ({{in_name[0]}}, {{in_name[1]}}, {{out_name[0]}}, {{in_name[0]}}_DIMS, {{in_name[1]}}_DIMS, {{out_name[0]}}_DIMS, {{name|upper}}_INPUT_A_DIMS_SIZE, {{name|upper}}_INPUT_B_DIMS_SIZE, {{name|upper}}_OUTPUT_DIMS_SIZE);
UndefinedError: 'dataformat' is undefined
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...
Can you please help me to solve the error ?
Thank you