Question/Issue: Cannot generate TinyML model via using python-sdk.
Project ID: 246447
Context/Use case: I am predicting IMU data via 1D CNN-based model. My board is Nicla Sense ME. The model architecture as follows:
Model: "sequential_19"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv1d_68 (Conv1D) (None, 41, 8) 368
max_pooling1d_38 (MaxPoolin (None, 13, 8) 0
g1D)
flatten_19 (Flatten) (None, 104) 0
dense_19 (Dense) (None, 9) 945
reshape_17 (Reshape) (None, 1, 9) 0
=================================================================
Total params: 1,313
Trainable params: 1,313
Non-trainable params: 0
When I try to generate my model via:
# Set the output name.
deploy_filename = "my_model_cpp.zip"
# Set model information, such as your list of labels
model_output_type = ei.model.output_type.Regression()
# Create C++ library with trained model.
# Initialize the tiny_model.
deploy_bytes = None
try:
deploy_bytes = ei.model.deploy(model=model,
model_output_type=model_output_type,
deploy_target='zip')
except Exception as e:
print(f"Could not deploy: {e}")
# Write the downloaded raw bytes to a file
if deploy_bytes:
with open(deploy_filename, 'wb') as f:
f.write(deploy_bytes)
I am getting the following error:
Could not deploy: Expected <class 'edgeimpulse.model.output_type.Regression'> model to have 2 output dimensions but has 3
My guess is, maybe it is due to timestep [32, 1, 9]? But I believe I need to have that there.
Also is python-sdk open source? I could only find the docs here: https://docs.edgeimpulse.com/reference/edgeimpulse
Many thanks.