简体   繁体   English

在树莓派 4 中运行推理几秒钟后,openvino 崩溃

[英]openvino crashes after running inference some seconds in raspberry pi 4

I tried to use Intel Neural Compute Stick 2 as an inference engine for my smart car.我尝试使用英特尔神经计算棒 2 作为智能汽车的推理引擎。

I installed l_openvino_toolkit_runtime_raspbian_p_2019.2.242.tgz followed by this link , and run the code for testing.我安装了 l_openvino_toolkit_runtime_raspbian_p_2019.2.242.tgz 后跟这个链接,并运行代码进行测试。

Everything was fine at the beginning of 10 - 20 seconds(sometimes less, sometimes longer), Then crashed with the following errors:在 10 - 20 秒开始时一切都很好(有时更少,有时更长),然后崩溃并出现以下错误:

E: [xLink] [ 327401] [EventRead00Thr] dispatcherEventReceive:336 dispatcherEventReceive() Read failed (err -4) | E: [xLink] [327401] [EventRead00Thr] dispatcherEventReceive:336 dispatcherEventReceive() 读取失败 (err -4) | event 0xaf1fdddc XLINK_READ_REL_REQ事件 0xaf1fdddc XLINK_READ_REL_REQ

E: [xLink] [ 327401] [EventRead00Thr] eventReader:223 eventReader thread stopped (err -4) E: [xLink] [ 327402] [python3] XLinkReadDataWithTimeOut:1323 Event data is invalid E: [xLink] [ 327401] [EventRead00Thr] eventReader:223 eventReader 线程已停止 (err -4) E: [xLink] [ 327402] [python3] XLinkReadDataWithTimeOut:1323 事件数据无效

E: [ncAPI] [ 327402] [python3] ncFifoReadElem:3445 Packet reading is failed. E: [ncAPI] [327402] [python3] ncFifoReadElem:3445 数据包读取失败。 terminate called after throwing an instance of 'InferenceEngine::details::InferenceEngineException'在抛出 'InferenceEngine::details::InferenceEngineException' 的实例后调用终止

what(): Failed to read output from FIFO: NC_ERROR什么():无法从 FIFO 读取 output:NC_ERROR

Aborted中止

I tried to insert it into the USB hub with a self-power adapter, but it still got the same errors.我尝试将它插入带有自供电适配器的 USB 集线器,但仍然出现相同的错误。 I also tried to insert it into the USB2.0, but still not working.我也尝试将它插入USB2.0,但仍然无法正常工作。

I checked out the dmesg, I found the Intel Neural Compute Stick 2 will be auto-mounted when I called net.forward() at some point.我检查了 dmesg,发现当我调用 net.forward() 时,英特尔神经计算棒 2 会自动安装。

I got dmesg information by following steps:我通过以下步骤获得了 dmesg 信息:

  1. check the ncs2 device is ok(I can find the device) before running the code.在运行代码之前检查 ncs2 设备是否正常(我可以找到该设备)。
  2. clear dmesg清除 dmesg
  3. running the code运行代码
  4. waiting for it crashed.等待它崩溃。 then, check out the dmesg.然后,查看 dmesg。

the dmesg showing: dmesg 显示:

[87255.685160] usb 1-1.1: USB disconnect, device number 25 [87255.685160] usb 1-1.1:USB 断开连接,设备编号 25

[87255.831256] usb 2-1: new SuperSpeed Gen 1 USB device number 18 using xhci_hcd [87255.831256] usb 2-1:新 SuperSpeed Gen 1 USB 设备号 18 使用 xhci_hcd

[87255.861963] usb 2-1: New USB device found, idVendor=03e7, idProduct=f63b, bcdDevice= 1.00 [87255.861963] usb 2-1:找到新的 USB 设备,idVendor=03e7,idProduct=f63b,bcdDevice=1.00

[87255.861970] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [87255.861970] usb 2-1:新 USB 设备字符串:Mfr=1,Product=2,SerialNumber=3

[87255.861975] usb 2-1: Product: VSC Loopback Device [87255.861975] usb 2-1:产品:VSC 环回设备

[87255.861980] usb 2-1: Manufacturer: Intel Corporation [87255.861980] usb 2-1:制造商:英特尔公司

[87255.861985] usb 2-1: SerialNumber: 41440410119541BC00 [87255.861985] usb 2-1:序列号:41440410119541BC00

[87280.181479] usb 1-1.1: new high-speed USB device number 26 using xhci_hcd [87280.181479] usb 1-1.1:使用 xhci_hcd 的新高速 USB 设备编号 26

[87280.312042] usb 1-1.1: New USB device found, idVendor=03e7, idProduct=2485, bcdDevice= 0.01 [87280.312042] usb 1-1.1:找到新的 USB 设备,idVendor=03e7,idProduct=2485,bcdDevice=0.01

[87280.312048] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [87280.312048] usb 1-1.1:新 USB 设备字符串:Mfr=1,Product=2,SerialNumber=3

[87280.312053] usb 1-1.1: Product: Movidius MyriadX [87280.312053] usb 1-1.1:产品:Movidius MyriadX

[87280.312058] usb 1-1.1: Manufacturer: Movidius Ltd. [87280.312058] usb 1-1.1:制造商:Movidius Ltd.

[87280.312063] usb 1-1.1: SerialNumber: 03e72485 [87280.312063] usb 1-1.1:序列号:03e72485

[87280.691784] usb 2-1: USB disconnect, device number 18 [87280.691784] usb 2-1:USB 断开连接,设备编号 18

My environment is: Raspberry Pi 4 (4GB) Raspbian Buster我的环境是:Raspberry Pi 4 (4GB) Raspbian Buster

I have debugged it serval days, but have no idea to solve this problem.我已经调试了几天,但不知道如何解决这个问题。 Is there anything I missed?有什么我错过的吗?

Thanks!谢谢!

The error seems to be related to the NCS2 device being reset for inference and fail to initialize during runtime.该错误似乎与 NCS2 设备被重置以进行推理有关,并且在运行时无法初始化。 Verify you have added the USB Rules for the Intel® Neural Compute Stick 2 device by performing the following steps.通过执行以下步骤,验证您已为英特尔® 神经计算棒 2 设备添加 USB 规则。

  1. Add the current Linux user to the users group:将当前 Linux 用户添加到 users 组:

    $ sudo usermod -a -G users "$(whoami)" $ sudo usermod -a -G users "$(whoami)"

    Log out and log in for it to take effect.注销并登录以使其生效。

  2. Run setupvars.sh again after logging in:登录后再次运行 setupvars.sh:

    $ source /opt/intel/openvino/bin/setupvars.sh $源/opt/intel/openvino/bin/setupvars.sh

  3. Install the USB rules running the install_NCS_udev_rules.sh script:安装运行 install_NCS_udev_rules.sh 脚本的 USB 规则:

    $ sh /opt/intel/openvino/install_dependencies/install_NCS_udev_rules.sh $ sh /opt/intel/openvino/install_dependencies/install_NCS_udev_rules.sh

  4. Proceed to run the demo application:继续运行演示应用程序:

    $ python3 SingleStickSSDwithUSBCamera_OpenVINO_NCS2.py $ python3 SingleStickSSDwithUSBCamera_OpenVINO_NCS2.py

Note the l_openvino_toolkit_runtime_raspbian_p_2019.2.242 is now quite outdated, and there have been newer software packages released.请注意l_openvino_toolkit_runtime_raspbian_p_2019.2.242现在已经过时了,并且已经发布了更新的软件包。 Checkout the OpenVINO™ Toolkit packages storage for the most recent release available (at the time of this post, 2021.4.1 - l_openvino_toolkit_runtime_raspbian_p_2021.4.689.tgz ).查看OpenVINO™ Toolkit 软件包存储以获取最新版本(在本文发布时,2021.4.1 - l_openvino_toolkit_runtime_raspbian_p_2021.4.689.tgz )。

I've executed the demo application you listed with OpenVINO 2021.4.1 for longer than 10 minutes and the error can't reproduce:我已经使用 OpenVINO 2021.4.1 执行了您列出的演示应用程序超过 10 分钟,并且错误无法重现:

演示应用程序运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM