Since you are already converting from .mat to .onnx, I’d suggest you go ahead and convert that .onnx into a TensorFlow frozen graph (.pb). Here’s the library suitable for that:

  
      

      github.com
  

  
    

onnx/onnx-tensorflow 18


  Tensorflow Backend for ONNX. Contribute to onnx/onnx-tensorflow development by creating an account on GitHub.

  

  
    
    
  

  


This will give you a model that accepts channels in the last dimension as per your specifications. Now, to convert the frozen graph into a TFLite model you can use tf.compat.v1.lite.TFLiteConverter.from_frozen_graph. Here’s an end-to-end example of using this:

  

      github.com
  

  
    sayakpaul/Adventures-in-TensorFlow-Lite/blob/master/DeepLabV3/DeepLab_TFLite_COCO.ipynb 24


    {
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "DeepLab_TFLite_COCO.ipynb",
      "provenance": [],
      "collapsed_sections": [],
      "toc_visible": true,
      "authorship_tag": "ABX9TyPr6XoNc6WdPO8DCVAjs4B1",
      "include_colab_link": true
    },
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",



  This file has been truncated. show original