<?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 Tensorflow Lite inference on Navq+ (eIQ generated tflite model) in eIQ Machine Learning Software</title>
    <link>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/Tensorflow-Lite-inference-on-Navq-eIQ-generated-tflite-model/m-p/1590939#M645</link>
    <description>&lt;P&gt;I was creating a custom dataset in eIQ, but I have not been able to interpret a valid output signature. I am starting with the object detection -balanced setting and have approximately 100 labeled images in my dataset.&lt;/P&gt;&lt;P&gt;After training and eval, I generate the output model and view it. It appears to be an identity of shape 1x1x65. This model was not quantized. Using the default 'label_image.py' resulted in an error complaining about list indices out of range.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I modified with this snippet:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;output_data = get_output_tensor(interpreter, 0)&lt;BR /&gt;xywh = output_data[..., :4]&lt;BR /&gt;conf = output_data[..., 4:5]&lt;BR /&gt;cls_data = output_data[..., 5:]&lt;BR /&gt;cls = cls_data.reshape(1,122040)&lt;BR /&gt;print("Classes: {}".format(cls))&lt;BR /&gt;print("Scores: {}".format(conf))&lt;BR /&gt;print("Boxes: {}".format(xywh))&lt;BR /&gt;output= np.squeeze(np.concatenate((xywh,conf,cls_data), axis=1))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, the outputs don't really seem to make sense, as I am getting negative scores that seem large (-20, -30, -1.4)&lt;/P&gt;&lt;P&gt;So I am not sure how to export the model out of eIQ for tflite that will run against label_image.py. Am I missing quantization? Also, should I be converting to int8 for input and output if I want to run a trained NPU model?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference, I am running this on a NavQ+ (IMX8m plus) and I was able to successfully run the tflite grace hopper example utilizing the NPU (external delegates):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@hovergames3&lt;/P&gt;</description>
    <pubDate>Wed, 01 Feb 2023 03:21:35 GMT</pubDate>
    <dc:creator>dirksavage881</dc:creator>
    <dc:date>2023-02-01T03:21:35Z</dc:date>
    <item>
      <title>Tensorflow Lite inference on Navq+ (eIQ generated tflite model)</title>
      <link>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/Tensorflow-Lite-inference-on-Navq-eIQ-generated-tflite-model/m-p/1590939#M645</link>
      <description>&lt;P&gt;I was creating a custom dataset in eIQ, but I have not been able to interpret a valid output signature. I am starting with the object detection -balanced setting and have approximately 100 labeled images in my dataset.&lt;/P&gt;&lt;P&gt;After training and eval, I generate the output model and view it. It appears to be an identity of shape 1x1x65. This model was not quantized. Using the default 'label_image.py' resulted in an error complaining about list indices out of range.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I modified with this snippet:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;output_data = get_output_tensor(interpreter, 0)&lt;BR /&gt;xywh = output_data[..., :4]&lt;BR /&gt;conf = output_data[..., 4:5]&lt;BR /&gt;cls_data = output_data[..., 5:]&lt;BR /&gt;cls = cls_data.reshape(1,122040)&lt;BR /&gt;print("Classes: {}".format(cls))&lt;BR /&gt;print("Scores: {}".format(conf))&lt;BR /&gt;print("Boxes: {}".format(xywh))&lt;BR /&gt;output= np.squeeze(np.concatenate((xywh,conf,cls_data), axis=1))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, the outputs don't really seem to make sense, as I am getting negative scores that seem large (-20, -30, -1.4)&lt;/P&gt;&lt;P&gt;So I am not sure how to export the model out of eIQ for tflite that will run against label_image.py. Am I missing quantization? Also, should I be converting to int8 for input and output if I want to run a trained NPU model?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference, I am running this on a NavQ+ (IMX8m plus) and I was able to successfully run the tflite grace hopper example utilizing the NPU (external delegates):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@hovergames3&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 03:21:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/Tensorflow-Lite-inference-on-Navq-eIQ-generated-tflite-model/m-p/1590939#M645</guid>
      <dc:creator>dirksavage881</dc:creator>
      <dc:date>2023-02-01T03:21:35Z</dc:date>
    </item>
  </channel>
</rss>

