<?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:Exception has occurred: KeyError in Intel® Distribution of OpenVINO™ Toolkit</title>
    <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1354797#M26418</link>
    <description>&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;Hi RGVGreatCoder,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;Thanks for reaching out to us and thanks for sharing your information with us.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;We are now investigating this issue and we will update you at the earliest.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;Wan&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 26 Jan 2022 14:13:18 GMT</pubDate>
    <dc:creator>Wan_Intel</dc:creator>
    <dc:date>2022-01-26T14:13:18Z</dc:date>
    <item>
      <title>Exception has occurred: KeyError 'boxes'</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1354206#M26388</link>
      <description>&lt;P&gt;When I execute a loaded network in my Python program, it crashes with the error "Exception has occurred: KeyError 'boxes'" (I get the same error in my WSL Ubuntu and Raspberry Pi 4).&amp;nbsp; I am implementing the code in this page "&lt;A href="https://docs.openvino.ai/latest/notebooks/004-hello-detection-with-output.html#" target="_blank" rel="noopener"&gt;https://docs.openvino.ai/latest/notebooks/004-hello-detection-with-output.html#&lt;/A&gt;" and, my program reads as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import matplotlib.pyplot as plt
import numpy as np
from openvino.inference_engine import IECore
...
openvino_xml = openvino_model_path + 'person-vehicle-bike-detection-crossroad-1016.xml'
openvino_weights = openvino_model_path + 'person-vehicle-bike-detection-crossroad-1016.bin'
device_name = 'MYRIAD' # try this on the Rpi4
# device_name = 'CPU'  # try this on WSL Ubuntu runnin in my laptop
picture = picture_captured_path + 'cars-expressway1.jpg'

ie = IECore()
net = ie.read_network(
    model=openvino_xml,
    weights=openvino_weights,
)
exec_net = ie.load_network(net, device_name)
input_layer_ir = next(iter(exec_net.input_info))
output_layer_ir = next(iter(exec_net.outputs))

# get input and output names of nodes
input_key = list(exec_net.input_info)[0]
output_key = list(exec_net.outputs.keys())[0]

def printOpenVino_InputOutputItems():
   print("Inputs:")
   for name, info in exec_net.input_info.items():
      print("\tname: {}".format(name))
      print("\tshape: {}".format(info.tensor_desc.dims))
      # print("\tlayout: {}".format(info.layout))
      print("\tprecision: {}\n".format(info.precision))

   print("Outputs:")
   for name, info in exec_net.outputs.items():
      print("\tname: {}".format(name))
      print("\tshape: {}".format(info.shape))
      print("\tlayout: {}".format(info.layout))
      print("\tprecision: {}\n".format(info.precision))

   print("input_key: " + input_key)
   print("output_key: " + output_key)


# Check values in Inputs and Outputs
printOpenVino_InputOutputItems()

imageFrame = cv.imread(picture)

if (type(imageFrame) == type(None)):
   break

# Resize with OpenCV your image if needed to match with net input shape
N, C, H, W = exec_net.input_info[input_layer_ir].tensor_desc.dims
resized_image = cv.resize(src=imageFrame, dsize=(W, H))      

# Converting image to NCHW format with FP32 type
input_data = np.expand_dims(resized_image.transpose(2, 0, 1), 0)

# DO INFERENCE
result = exec_net.infer(inputs={input_layer_ir: input_data})

# Extract list of boxes from results
boxes = result["boxes"]
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;When I run this program, it first executes the&amp;nbsp;printOpenVino_InputOutputItems()&amp;nbsp; method printing these results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Inputs:
        name: input.1
        shape: [1, 3, 512, 512]
        precision: FP32

Outputs:
        name: 653
        shape: [1, 1, 200, 7]
        layout: NCHW
        precision: FP32

input_key: input.1
output_key: 653
Backend QtAgg is interactive backend. Turning interactive mode on.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then in line 62 of my program (where I try to extract the boxes from the results variable), I get the following error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Exception has occurred: KeyError
'boxes'
  File "/home/winlinuxuser/projects/classify-vehicle/openvino-pi4-vehicle-person.py", line 62
    boxes = result["boxes"]
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Putting a breakpoint in line 59 (using VSCode), I could read the content in the "result" variable and, it was the following one:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result-value.jpg" style="width: 446px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/25952iDD36652A5135712D/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="result-value.jpg" alt="result-value.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Questions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Why am I getting this error?&lt;/LI&gt;
&lt;LI&gt;How can I extract the boxes from the result variable?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Thank you in advance for all your support and will be waiting for your reply,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 22:02:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1354206#M26388</guid>
      <dc:creator>RGVGreatCoder</dc:creator>
      <dc:date>2022-01-24T22:02:14Z</dc:date>
    </item>
    <item>
      <title>Re:Exception has occurred: KeyError</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1354797#M26418</link>
      <description>&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;Hi RGVGreatCoder,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;Thanks for reaching out to us and thanks for sharing your information with us.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;We are now investigating this issue and we will update you at the earliest.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helvetica, sans-serif; font-size: 16px;"&gt;Wan&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jan 2022 14:13:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1354797#M26418</guid>
      <dc:creator>Wan_Intel</dc:creator>
      <dc:date>2022-01-26T14:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Exception has occurred: KeyError 'boxes'</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1355125#M26433</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi RGVGreatCoder,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I noticed that the &lt;/SPAN&gt;&lt;A style="font-family: Helvetica, sans-serif; font-size: 16px;" href="https://docs.openvino.ai/latest/omz_models_model_horizontal_text_detection_0001.html" target="_blank" rel="noopener noreferrer"&gt;horizontal-text-detection-0001&lt;/A&gt;&lt;SPAN&gt; contains &lt;/SPAN&gt;&lt;SPAN&gt;boxes&lt;/SPAN&gt;&lt;SPAN&gt; as one of the &lt;/SPAN&gt;&lt;SPAN&gt;Results.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="horizon.JPG" style="width: 784px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/26056iAEA54BD0410A3988/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="horizon.JPG" alt="horizon.JPG" /&gt;&lt;/span&gt;&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;while &lt;/SPAN&gt;&lt;A style="font-family: Helvetica, sans-serif; font-size: 16px;" href="https://docs.openvino.ai/latest/omz_models_model_person_vehicle_bike_detection_crossroad_1016.html" target="_blank" rel="noopener noreferrer"&gt;person-vehicle-bike-detection-crossroad-1016&lt;/A&gt;&lt;SPAN&gt; only contains &lt;/SPAN&gt;&lt;SPAN&gt;detection_out&lt;/SPAN&gt;&lt;SPAN&gt; as a &lt;/SPAN&gt;&lt;SPAN&gt;Result&lt;/SPAN&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="customer_model.JPG" style="width: 779px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/26057iCD749D4049865CC7/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="customer_model.JPG" alt="customer_model.JPG" /&gt;&lt;/span&gt;&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;You may check it by using &lt;/SPAN&gt;&lt;A style="font-family: Helvetica, sans-serif; font-size: 16px;" href="https://netron.app/" target="_blank" rel="noopener noreferrer"&gt;Netron&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As a workaround, I suggest you use the &lt;/SPAN&gt;&lt;A style="font-family: Helvetica, sans-serif; font-size: 16px;" href="https://github.com/openvinotoolkit/openvino/tree/2021.4.2/inference-engine/ie_bridges/python/sample/object_detection_sample_ssd#object-detection-ssd-python-sample-openvino_inference_engine_ie_bridges_python_sample_object_detection_sample_ssd_readme" target="_blank" rel="noopener noreferrer"&gt;Object Detection SSD Python Sample&lt;/A&gt;&lt;SPAN&gt;. The demo is located under the following directory:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&amp;lt;INSTALL_DIR&amp;gt;\inference_engine\samples\python\object_detection_sample_ssd&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&amp;nbsp;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;On another note, I have validated the demo application with person-vehicle-bike-detection-crossroad-1016 as shown as follows.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/26058i230803EF207D6133/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Wan&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 12:42:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1355125#M26433</guid>
      <dc:creator>Wan_Intel</dc:creator>
      <dc:date>2022-01-27T12:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Exception has occurred: KeyError 'boxes'</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1355761#M26453</link>
      <description>&lt;P&gt;You suggest me to look for the sample in this directory:&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&amp;lt;INSTALL_DIR&amp;gt;\inference_engine\samples\python\object_detection_sample_ssd&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;I cannot find this directory. I installed OpenVINO toolkit using PIP. Where should I find the sample if I used PIP?&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jan 2022 19:29:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1355761#M26453</guid>
      <dc:creator>RGVGreatCoder</dc:creator>
      <dc:date>2022-01-29T19:29:01Z</dc:date>
    </item>
    <item>
      <title>Re:Exception has occurred: KeyError</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1355982#M26466</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Hi RGVGreatCoder,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Yes, you are correct. OpenVINO Toolkit PIP Package does not come with the Inference Engine Samples directory.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;You could instead, find the particular &lt;/SPAN&gt;&lt;A href="https://github.com/openvinotoolkit/openvino/blob/2021.4.2/inference-engine/ie_bridges/python/sample/object_detection_sample_ssd/object_detection_sample_ssd.py" rel="noopener noreferrer" target="_blank" style="font-size: 16px;"&gt;Object Detection SSD Python Sample&lt;/A&gt;&lt;SPAN style="font-size: 16px;"&gt; from GitHub. Download or copy the Python Sample script and place it in your directory.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Since you're using the OpenVINO PIP Package, use the following command to get the necessary models for the Python sample:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier; font-size: 16px;"&gt;omz_downloader --name mobilenet-ssd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier; font-size: 16px;"&gt;omz_converter --name mobilenet-ssd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Once downloaded, run the Object Detection SSD Python Sample with the following command:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier; font-size: 16px;"&gt;python &amp;lt;path_to_sample&amp;gt;/object_detection_sample_ssd.py -m &amp;lt;path_to_model&amp;gt;/mobilenet-ssd.xml -i &amp;lt;path_to_image&amp;gt; -d CPU&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&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;Hairul&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jan 2022 09:51:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1355982#M26466</guid>
      <dc:creator>Hairul_Intel</dc:creator>
      <dc:date>2022-01-31T09:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Exception has occurred: KeyError 'boxes'</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1358282#M26529</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi RGVGreatCoder,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This thread will no longer be monitored since we have provided a suggestion.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you need any additional information from Intel, please submit a new question.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Wan&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 03:08:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exception-has-occurred-KeyError-boxes/m-p/1358282#M26529</guid>
      <dc:creator>Wan_Intel</dc:creator>
      <dc:date>2022-02-08T03:08:54Z</dc:date>
    </item>
  </channel>
</rss>

