<?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:Tiny yolo v4 IR model conversion errors in Intel® Distribution of OpenVINO™ Toolkit</title>
    <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tiny-yolo-v4-IR-model-conversion-errors/m-p/1354736#M26415</link>
    <description>&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Hi Pranathi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Thanks for reaching out to us.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;For your information, we have &lt;/SPAN&gt;&lt;A href="https://docs.openvino.ai/2021.4/omz_models_model_yolo_v4_tiny_tf.html" rel="noopener noreferrer" target="_blank" style="font-size: 16px;"&gt;yolo-v4-tiny-tf&lt;/A&gt;&lt;SPAN style="font-size: 16px;"&gt; in Open Model Zoo and it is implemented in Keras framework and then converted to TensorFlow and IR. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Please try convert your weights file and cgf file into Keras model and then to TensorFlow model according to repository below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/david8862/keras-YOLOv3-model-set" rel="noopener noreferrer" target="_blank" style="font-size: 16px;"&gt;https://github.com/david8862/keras-YOLOv3-model-set&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Convert from weights and cgf files to Keras model (.h5):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 16px;"&gt;python3 keras-YOLOv3-model-set/tools/model_converter/convert.py &amp;lt;config_path&amp;gt;.cfg &amp;lt;weight_path&amp;gt;.weights &amp;lt;output_path&amp;gt;.h5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Convert from Keras model to TensorFlow model (.pb):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 16px;"&gt;python3 keras-YOLOv3-model-set/tools/model_converter/keras_to_tensorflow.py --input_model &amp;lt;path&amp;gt;.h5 --output_model &amp;lt;output-path&amp;gt;.pb&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Convert from TensorFlow model to Intermediate Representation (IR):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 16px;"&gt;python3 mo_tf.py --input_model &amp;lt;model&amp;gt;.pb --reverse_input_channels --input_shape=[1,416,416, 3] --data_type=FP32 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;We would like to request your weights and cfg files if this method doesn’t helpful for you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Peh&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 26 Jan 2022 09:15:01 GMT</pubDate>
    <dc:creator>Peh_Intel</dc:creator>
    <dc:date>2022-01-26T09:15:01Z</dc:date>
    <item>
      <title>Tiny yolo v4 IR model conversion errors</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tiny-yolo-v4-IR-model-conversion-errors/m-p/1354466#M26402</link>
      <description>Hi there, I recently got a intel Neural compute stick and I plan on running a custom yolo v4 model for object detection of 4 classes on my custom dataset. I used darknet to generate this model and tested it using darknet on both validation and other unseen data by the model and both work well. So, I am trying now to convert that .weights file obtained from darknet to .pb file and then to IR model. For the .pb file I used below repo&lt;BR /&gt;&lt;A href="https://github.com/TNTWEN/OpenVINO-YOLOV4" target="_blank"&gt;https://github.com/TNTWEN/OpenVINO-YOLOV4&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;For weights conversion, I used the below command and I got a protobuf file with no errors&lt;BR /&gt;```python3 convert_weights_pb.py --class_names obj.names  --weights_file yolov4-tiny-obj_best.weights ---data_format NHWC --tiny```&lt;BR /&gt;&lt;BR /&gt;After that, I am trying to use the most recent openvino version 2021.4 python3.7 and tensorflow 1.15.5 and below command to convert the so obtained pb file, frozen_darknet_yolov4_model.pb &lt;BR /&gt;&lt;BR /&gt;```mo_tf.py --input_model ./OpenVINO-YOLOV4/frozen_darknet_yolov4_model.pb --transformations_config ./OpenVINO-YOLOV4/yolo_v4_tiny.json --reverse_input_channels '--input_shape=[1,416,416, 3]'  --data_type=FP32 --log_level=DEBUG```&lt;BR /&gt;&lt;BR /&gt;Could you please help with the error below?&lt;BR /&gt;Below is my error traceback with debug enabled&lt;BR /&gt;```&lt;BR /&gt;[ 2022-01-24 21:38:39,388 ] [ DEBUG ] [ infer:116 ]  --------------------&lt;BR /&gt;[ 2022-01-24 21:38:39,388 ] [ DEBUG ] [ infer:117 ]  Partial infer for detector/yolo-v4-tiny/Pad_1&lt;BR /&gt;[ 2022-01-24 21:38:39,388 ] [ DEBUG ] [ infer:118 ]  Op: Pad&lt;BR /&gt;[ 2022-01-24 21:38:39,388 ] [ DEBUG ] [ infer:119 ]  Inputs:&lt;BR /&gt;[ 2022-01-24 21:38:39,389 ] [ DEBUG ] [ infer:19 ]  input[0]: shape = [  1  32 208 208], value = &amp;lt;UNKNOWN&amp;gt;&lt;BR /&gt;[ 2022-01-24 21:38:39,389 ] [ DEBUG ] [ infer:19 ]  input[1]: shape = [4], value = [0 0 1 1]&lt;BR /&gt;[ 2022-01-24 21:38:39,389 ] [ DEBUG ] [ infer:19 ]  input[2]: shape = [4], value = [0 0 1 1]&lt;BR /&gt;[ 2022-01-24 21:38:39,390 ] [ DEBUG ] [ infer:132 ]  Outputs:&lt;BR /&gt;[ 2022-01-24 21:38:39,391 ] [ DEBUG ] [ infer:19 ]  output[0]: shape = [  1  32 210 210], value = &amp;lt;UNKNOWN&amp;gt;&lt;BR /&gt;[ 2022-01-24 21:38:39,391 ] [ DEBUG ] [ infer:116 ]  --------------------&lt;BR /&gt;[ 2022-01-24 21:38:39,391 ] [ DEBUG ] [ infer:117 ]  Partial infer for detector/yolo-v4-tiny/Tile/YoloRegion&lt;BR /&gt;[ 2022-01-24 21:38:39,391 ] [ DEBUG ] [ infer:118 ]  Op: RegionYolo&lt;BR /&gt;[ 2022-01-24 21:38:39,391 ] [ DEBUG ] [ infer:119 ]  Inputs:&lt;BR /&gt;[ 2022-01-24 21:38:39,392 ] [ DEBUG ] [ infer:19 ]  input[0]: shape = [169   6], value = [[ 0.  0.  0.  0.  0.  0.]&lt;BR /&gt; [ 1.  0.  1.  0.  1.  0.]&lt;BR /&gt; [ 2.  0.  2.  0.  2.  0.]&lt;BR /&gt; ...&lt;BR /&gt; [10. 12. 1...&lt;BR /&gt;[ ERROR ]  Cannot infer shapes or values for node "detector/yolo-v4-tiny/Tile/YoloRegion".&lt;BR /&gt;[ ERROR ]  index 2 is out of bounds for axis 0 with size 2&lt;BR /&gt;[ ERROR ]  &lt;BR /&gt;[ ERROR ]  It can happen due to bug in custom shape infer function &amp;lt;function RegionYoloOp.regionyolo_infer at 0x7fc843ca8830&amp;gt;.&lt;BR /&gt;[ ERROR ]  Or because the node inputs have incorrect values/shapes.&lt;BR /&gt;[ ERROR ]  Or because input shapes are incorrect (embedded to the model or passed via --input_shape).&lt;BR /&gt;[ 2022-01-24 21:38:39,393 ] [ DEBUG ] [ infer:184 ]  Node "detector/yolo-v4-tiny/Tile/YoloRegion" attributes: {'kind': 'op', 'type': 'RegionYolo', 'op': 'RegionYolo', 'version': 'opset1', 'in_ports_count': 1, 'out_ports_count': 1, 'infer': &amp;lt;function RegionYoloOp.regionyolo_infer at 0x7fc843ca8830&amp;gt;, 'name': 'detector/yolo-v4-tiny/Tile/YoloRegion', 'axis': 1, 'end_axis': 1, 'do_softmax': 0, 'classes': 4, 'anchors': [10, 14, 23, 27, 37, 58, 81, 82, 135, 169, 344, 319], 'coords': 4, 'num': 6, 'entry_points': ['detector/yolo-v4-tiny/Reshape', 'detector/yolo-v4-tiny/Reshape_4'], 'mask': [0, 1, 2], 'dim_attrs': ['channel_dims', 'spatial_dims', 'batch_dims'], 'shape_attrs': ['window', 'stride', 'shape', 'output_shape', 'pad'], 'IE': [('layer', [('id', &amp;lt;function Op.substitute_ie_attrs.&amp;lt;locals&amp;gt;.&amp;lt;lambda&amp;gt; at 0x7fc82db1b050&amp;gt;), 'name', 'type', 'version'], [('data', ['coords', 'classes', 'num', 'axis', 'end_axis', ('do_softmax', &amp;lt;function RegionYoloOp.backend_attrs.&amp;lt;locals&amp;gt;.&amp;lt;lambda&amp;gt; at 0x7fc82db1b0e0&amp;gt;), ('anchors', &amp;lt;function RegionYoloOp.backend_attrs.&amp;lt;locals&amp;gt;.&amp;lt;lambda&amp;gt; at 0x7fc82db1b170&amp;gt;), ('mask', &amp;lt;function RegionYoloOp.backend_attrs.&amp;lt;locals&amp;gt;.&amp;lt;lambda&amp;gt; at 0x7fc82db1b200&amp;gt;)], []), '@ports', '@consts'])], '_in_ports': {0: {}}, '_out_ports': {0: {}}, 'is_output_reachable': True, 'is_undead': False, 'is_const_producer': False, 'is_partial_inferred': False}&lt;BR /&gt;[ ERROR ]  Exception occurred during running replacer "REPLACEMENT_ID" (&amp;lt;class 'extensions.middle.PartialInfer.PartialInfer'&amp;gt;): Stopped shape/value propagation at "detector/yolo-v4-tiny/Tile/YoloRegion" node. &lt;BR /&gt; For more information please refer to Model Optimizer FAQ, question #38. (&lt;A href="https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html?question=38#question-38" target="_blank"&gt;https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html?question=38#question-38&lt;/A&gt;)&lt;BR /&gt;[ 2022-01-24 21:38:39,400 ] [ DEBUG ] [ main:410 ]  Traceback (most recent call last):&lt;BR /&gt;  File "/opt/intel/openvino_2021/deployment_tools/model_optimizer/mo/middle/passes/infer.py", line 122, in partial_infer&lt;BR /&gt;    node.infer(node)&lt;BR /&gt;  File "/opt/intel/openvino_2021/deployment_tools/model_optimizer/extensions/ops/regionyolo.py", line 71, in regionyolo_infer&lt;BR /&gt;    width=input_shape[get_width_dim(layout, 4)])&lt;BR /&gt;IndexError: index 2 is out of bounds for axis 0 with size 2&lt;BR /&gt;```&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Tue, 25 Jan 2022 14:53:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tiny-yolo-v4-IR-model-conversion-errors/m-p/1354466#M26402</guid>
      <dc:creator>Pranathi</dc:creator>
      <dc:date>2022-01-25T14:53:35Z</dc:date>
    </item>
    <item>
      <title>Re:Tiny yolo v4 IR model conversion errors</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tiny-yolo-v4-IR-model-conversion-errors/m-p/1354736#M26415</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Hi Pranathi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Thanks for reaching out to us.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;For your information, we have &lt;/SPAN&gt;&lt;A href="https://docs.openvino.ai/2021.4/omz_models_model_yolo_v4_tiny_tf.html" rel="noopener noreferrer" target="_blank" style="font-size: 16px;"&gt;yolo-v4-tiny-tf&lt;/A&gt;&lt;SPAN style="font-size: 16px;"&gt; in Open Model Zoo and it is implemented in Keras framework and then converted to TensorFlow and IR. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Please try convert your weights file and cgf file into Keras model and then to TensorFlow model according to repository below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/david8862/keras-YOLOv3-model-set" rel="noopener noreferrer" target="_blank" style="font-size: 16px;"&gt;https://github.com/david8862/keras-YOLOv3-model-set&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Convert from weights and cgf files to Keras model (.h5):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 16px;"&gt;python3 keras-YOLOv3-model-set/tools/model_converter/convert.py &amp;lt;config_path&amp;gt;.cfg &amp;lt;weight_path&amp;gt;.weights &amp;lt;output_path&amp;gt;.h5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Convert from Keras model to TensorFlow model (.pb):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 16px;"&gt;python3 keras-YOLOv3-model-set/tools/model_converter/keras_to_tensorflow.py --input_model &amp;lt;path&amp;gt;.h5 --output_model &amp;lt;output-path&amp;gt;.pb&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Convert from TensorFlow model to Intermediate Representation (IR):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 16px;"&gt;python3 mo_tf.py --input_model &amp;lt;model&amp;gt;.pb --reverse_input_channels --input_shape=[1,416,416, 3] --data_type=FP32 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;We would like to request your weights and cfg files if this method doesn’t helpful for you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Peh&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jan 2022 09:15:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tiny-yolo-v4-IR-model-conversion-errors/m-p/1354736#M26415</guid>
      <dc:creator>Peh_Intel</dc:creator>
      <dc:date>2022-01-26T09:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Tiny yolo v4 IR model conversion errors</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tiny-yolo-v4-IR-model-conversion-errors/m-p/1359576#M26560</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Pranathi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This thread will no longer be monitored since we have provided a solution.&amp;nbsp;If you need any additional information from Intel, please submit a new question.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Munesh&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 18:26:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tiny-yolo-v4-IR-model-conversion-errors/m-p/1359576#M26560</guid>
      <dc:creator>Munesh_Intel</dc:creator>
      <dc:date>2022-02-11T18:26:37Z</dc:date>
    </item>
  </channel>
</rss>

