<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Tensorflow Savedmodel to tflite conversion which supports IMX8MP NPU in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2177953#M241045</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/151788"&gt;@Zhiming_Liu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please mention BSP version and tflite version?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Subba Reddy&lt;/P&gt;</description>
    <pubDate>Tue, 30 Sep 2025 06:57:34 GMT</pubDate>
    <dc:creator>subbareddyai</dc:creator>
    <dc:date>2025-09-30T06:57:34Z</dc:date>
    <item>
      <title>Tensorflow Savedmodel to tflite conversion which supports IMX8MP NPU</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2175458#M240924</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to convert the&amp;nbsp;Tensorflow Savedmodel to tflite model which supports imx8mp NPU.&lt;/P&gt;&lt;P&gt;I followed the below steps with no success&lt;/P&gt;&lt;P&gt;python models/research/object_detection/exporter_main_v2.py \&lt;BR /&gt;--input_type image_tensor \&lt;BR /&gt;--pipeline_config_path training_dir/pipeline.config \&lt;BR /&gt;--trained_checkpoint_dir training_dir/checkpoint \&lt;BR /&gt;--output_directory exported-model&lt;/P&gt;&lt;P&gt;and I make sure its fixed shape&amp;nbsp;model {&lt;BR /&gt;ssd {&lt;BR /&gt;image_resizer {&lt;BR /&gt;fixed_shape_resizer {&lt;BR /&gt;height: 320&lt;BR /&gt;width: 320&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and also&amp;nbsp;Ensure TFLite-Compatible Ops&amp;nbsp;&lt;/P&gt;&lt;P&gt;ssd {&lt;BR /&gt;feature_extractor {&lt;BR /&gt;type: "ssd_mobilenet_v2_fpn_keras"&lt;BR /&gt;use_depthwise: true&lt;BR /&gt;}&lt;BR /&gt;box_predictor {&lt;BR /&gt;convolutional_box_predictor {&lt;BR /&gt;use_depthwise: true&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;tflite conversion script&amp;nbsp;&lt;/P&gt;&lt;P&gt;import tensorflow as tf&lt;BR /&gt;import pathlib&lt;/P&gt;&lt;P&gt;saved_model_dir = "exported-model/saved_model"&lt;/P&gt;&lt;P&gt;converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir)&lt;BR /&gt;converter.optimizations = [tf.lite.Optimize.DEFAULT]&lt;/P&gt;&lt;P&gt;# Provide representative dataset for INT8 calibration&lt;BR /&gt;def representative_data_gen():&lt;BR /&gt;data_dir = pathlib.Path("dataset/val")&lt;BR /&gt;for img_path in data_dir.glob("*.jpg"):&lt;BR /&gt;img = tf.keras.preprocessing.image.load_img(img_path, target_size=(320, 320))&lt;BR /&gt;img = tf.keras.preprocessing.image.img_to_array(img)&lt;BR /&gt;img = img[tf.newaxis, ...] / 255.0&lt;BR /&gt;yield [img.astype("float32")]&lt;/P&gt;&lt;P&gt;converter.representative_dataset = representative_data_gen&lt;BR /&gt;converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]&lt;BR /&gt;converter.inference_input_type = tf.uint8&lt;BR /&gt;converter.inference_output_type = tf.uint8&lt;/P&gt;&lt;P&gt;tflite_model = converter.convert()&lt;/P&gt;&lt;P&gt;with open("model_int8.tflite", "wb") as f:&lt;BR /&gt;f.write(tflite_model)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;command to run the inference with&amp;nbsp;model_int8.tflite&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ USE_GPU_INFERENCE=0 \&lt;BR /&gt;python3 label_image.py -m model_int8.tflite \&lt;BR /&gt;-e /usr/lib/liblitert_vx_delegate.so&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help me if these steps correct.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried converting model using eIQ tool but not working.&lt;/P&gt;&lt;P&gt;Related Post :&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-imx8mp/m-p/2169341#M240717" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-imx8mp/m-p/2169341#M240717&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I'm facing this problem almost a month. No solution. I above won't workout. Is it possible to develop tf savedmodel with tflite supported ops from scratch?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2025 05:15:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2175458#M240924</guid>
      <dc:creator>subbareddyai</dc:creator>
      <dc:date>2025-09-25T05:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Tensorflow Savedmodel to tflite conversion which supports IMX8MP NPU</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2176142#M240958</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;1.Your TFLite model uses the EXP op, version 2, which is not supported by the runtime you're using.&lt;/P&gt;
&lt;P&gt;2.The NPU delegate or TFLite runtime on your i.MX8MP device is too old to support this op version.&lt;/P&gt;
&lt;P&gt;3.You need to ensure that your model avoids using ops like EXP, or uses only version 1 of them. To do this: Use &lt;STRONG&gt;converter.experimental_new_converter = False&lt;/STRONG&gt; to force the old converter (which may avoid newer op versions).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 00:07:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2176142#M240958</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2025-09-26T00:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Tensorflow Savedmodel to tflite conversion which supports IMX8MP NPU</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2176912#M240988</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the reply and I tried with conversion code that I mentioned below with no success&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;tensorflow&lt;/SPAN&gt; &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;tf&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# Path to your exported SavedModel directory&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;saved_model_dir&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;r&lt;/SPAN&gt;&lt;SPAN&gt;"ssd-mobilenet-v2-tensorflow2-fpnlite-320x320-v1"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# Load the SavedModel&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;model&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;tf&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;saved_model&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;load&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;saved_model_dir&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# Get the concrete function for serving&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;concrete_func&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;model&lt;/SPAN&gt;&lt;SPAN&gt;.signatures[&lt;/SPAN&gt;&lt;SPAN&gt;"serving_default"&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# &lt;LI-EMOJI id="lia_white-heavy-check-mark" title=":white_heavy_check_mark:"&gt;&lt;/LI-EMOJI&gt; Fix input shape (must match your model resolution, here 320x320x3)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;concrete_func&lt;/SPAN&gt;&lt;SPAN&gt;.inputs[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;].set_shape([&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;320&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;320&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# Create TFLite converter&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;converter&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;tf&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;lite&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;TFLiteConverter&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;from_concrete_functions&lt;/SPAN&gt;&lt;SPAN&gt;([&lt;/SPAN&gt;&lt;SPAN&gt;concrete_func&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# &lt;LI-EMOJI id="lia_white-heavy-check-mark" title=":white_heavy_check_mark:"&gt;&lt;/LI-EMOJI&gt; Force old converter (avoids ops like EXP v2)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;converter&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;experimental_new_converter&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;False&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# &lt;LI-EMOJI id="lia_white-heavy-check-mark" title=":white_heavy_check_mark:"&gt;&lt;/LI-EMOJI&gt; Restrict to built-in ops only (for NPU compatibility)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;converter&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;target_spec&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;supported_ops&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN&gt;tf&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;lite&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;OpsSet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;TFLITE_BUILTINS&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# (Optional) Quantization for smaller/faster model&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# converter.optimizations = [tf.lite.Optimize.DEFAULT]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# Convert to TFLite&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;tflite_model&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;converter&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;convert&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# Save the converted model&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;output_file&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"ssd_mobilenet_v2_fixed.tflite"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;with&lt;/SPAN&gt; &lt;SPAN&gt;open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;output_file&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"wb"&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;write&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;tflite_model&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;LI-EMOJI id="lia_white-heavy-check-mark" title=":white_heavy_check_mark:"&gt;&lt;/LI-EMOJI&gt; Conversion complete. Saved as &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;output_file&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It would be great if there is complete procedure to convert savedmodel to tflite model which support imx8mp npu.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 27 Sep 2025 06:46:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2176912#M240988</guid>
      <dc:creator>subbareddyai</dc:creator>
      <dc:date>2025-09-27T06:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Tensorflow Savedmodel to tflite conversion which supports IMX8MP NPU</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2177947#M241044</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/254707"&gt;@subbareddyai&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please consider upgrade the BSP version to update the TFlite verison.&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 06:51:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2177947#M241044</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2025-09-30T06:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Tensorflow Savedmodel to tflite conversion which supports IMX8MP NPU</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2177953#M241045</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/151788"&gt;@Zhiming_Liu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please mention BSP version and tflite version?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Subba Reddy&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 06:57:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2177953#M241045</guid>
      <dc:creator>subbareddyai</dc:creator>
      <dc:date>2025-09-30T06:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Tensorflow Savedmodel to tflite conversion which supports IMX8MP NPU</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2177957#M241046</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/254707"&gt;@subbareddyai&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using NXP EVK, you can download the demo image from here.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/design/design-center/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applications-processors:IMXLINUX" target="_blank"&gt;https://www.nxp.com/design/design-center/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applications-processors:IMXLINUX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using third party board, please contact them to get latest BSP they ported.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 07:00:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Tensorflow-Savedmodel-to-tflite-conversion-which-supports-IMX8MP/m-p/2177957#M241046</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2025-09-30T07:00:51Z</dc:date>
    </item>
  </channel>
</rss>

