tum-ei-eda / mlonmcu

Tool for the deployment and analysis of TinyML applications on TFLM and MicroTVM backends
Apache License 2.0
28 stars 12 forks source link

Make model info optional for TVM backends #70

Closed PhilippvK closed 1 year ago

PhilippvK commented 2 years ago

We currently need to load our TFLite/TF models before invoking the TVMC command line to populate the --input-shapes argument, which is optional for most model types. Let's loosen up the requirement for model infos here which should make it easier to support more model formats in the future.

Just as a note: The refactored validate feature (using .npz files instead of raw .bin files) will eventually need the model info anyway to map model input names to input indices.

PhilippvK commented 1 year ago

This can not be implemented as easy as I thought, because the tvm wrapper generation currently depends on this. Let's hope that at some time TVM can generate those details (input shapes etc.) for us (There seems to already be work in that direction)

PhilippvK commented 1 year ago

@rafzi

As I recently had to deal with dynamic and complex shapes I finally was able to resolve this.

I've implemented the following (not pushed yet):

This way we have to rely less on the ModelInfo parsers and also can deal much better with dynamic/unknown shapes.

rafzi commented 1 year ago

Great, sounds like a good solution!