13. Frequently Asked Questions (FAQs)ΒΆ

  1. Q: How to resolve the following error message when compiling an ONNX model exported from PyTorch?

    ERROR:TVMC: dynamic shape not supported.
    

    A: This error could be caused by exporting a PyTorch model with dynamic input and output shapes. For example, if your torch.onnx.export() call contains a dynamic_axes argument, remove it.

  2. Q: How to compile models in Keras(.h5) format via TFLite conversion for F29x devices?

    A: We recommend using the TFLiteConverter utility in the TensorFlow Python package to convert the model into TFLite format first, and then compiling the TFLite model.

    We do not recommend this conversion path for non-F29x devices, for example, C28x/TI-NPU based devices, since we do not support TI-NPU QAT for Keras.

    # pip install tensorflow
    from tensorflow import lite
    from tensorflow import keras
    
    h5_model = keras.models.load_model("./model.h5")
    converter = lite.TFLiteConverter.from_keras_model(h5_model)
    tflite_model = converter.convert()
    with open("model.tflite", "wb") as f:
      f.write(tflite_model)