当前位置:   article > 正文

RuntimeError: Failed to allocate graph: MYRIAD device is not opened

failed to allocate graph: myriad device is not opened

RuntimeError: Failed to allocate graph: MYRIAD device is not opened


验证blob文件的正确性的时候【验证blob文件,文末贴上】,openvino出现了错误,对于错误,找到主要错误:

E: [ncAPI] [    675891] [python] getFirmwarePath:654	Firmware not found in: /home/shamus/anaconda3/envs/blob/lib/python3.7/site-packages/openvino/libs/usb-ma248x.mvcmd
E: [ncAPI] [    675891] [python] ncDeviceOpen:919	Can't get firmware, error: NC_ERROR
Traceback (most recent call last):
  File "/home/shamus/yuxueshan/NEW/depthai_DDSix_4/conver/check_blob_test.py", line 30, in <module>
    exec_net, input_blob = get_net(model_blob)
  File "/home/shamus/yuxueshan/NEW/depthai_DDSix_4/conver/check_blob_test.py", line 13, in get_net
    exec_net = ie.import_network(model_blob, device_name=device_name)
  File "ie_api.pyx", line 463, in openvino.inference_engine.ie_api.IECore.import_network
  File "ie_api.pyx", line 494, in openvino.inference_engine.ie_api.IECore.import_network
RuntimeError: Failed to allocate graph: MYRIAD device is not opened.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

大体来说,就是找不到usb-ma248x.mvcmd文件,(当然前提是:myriad的库装了)
RuntimeError: Failed to allocate graph: MYRIAD device is not opened
解决方案:
找到文件的位置【我之前是挨个找的】

如果你的openvino安装的时候用的普通用户,位置是在usr/local/intel/openvino_2022/runtime/lib/intel64/usb-ma2x8x.mvcmd:
usb
复制文件,到你现在环境(一般都是虚拟环境下的安装的openvino库中)

~/anaconda3/envs/blob/lib/python3.7/site-packages/openvino/libs在这里插入图片描述
然后重新运行程序:(Victory~)【当然是王者男孩发出的开心】
在这里插入图片描述
答应大家的验证blob文件正确性的代码【当然你得对应作出修改,直接复制粘贴肯定达咩的】

"""
IR--->blob
https://aistudio.baidu.com/aistudio/projectdetail/2358719
"""
from openvino.inference_engine import IECore
import numpy as np

model_blob = r'/home/shamus/yuxueshan/check.blob'


def get_net(model_blob, device_name='MYRIAD'):
    ie = IECore()
    exec_net = ie.import_network(model_blob, device_name=device_name)
    input_blob = next(iter(exec_net.input_info))
    return exec_net, input_blob


# Run inference
overlay_data = [147, 147, 246, 245, 317, 317, 396, 390, 125, 244, 152, 152, 249, 249, 321, 323, 401, 396, 130, 249, 159,
                160, 257, 257, 328, 331, 407, 406, 139, 255, 171, 172, 267, 269, 337, 340, 415, 414, 150, 264, 183, 183,
                278, 281, 348, 350, 421, 423, 161, 276, 193, 192, 287, 290, 358, 359, 428, 430, 170, 286, 196, 196, 293,
                296, 363, 363, 432, 435, 175, 291]
overlay_data = np.array(overlay_data, dtype=np.float32)
overlay_data.resize((7, 10))
overlay_data = np.dstack(
    (overlay_data, overlay_data, overlay_data))  # 单通道数据变三通道数据(action_fre*interest变为action_fre*interest*3)
overlay_data = overlay_data.transpose((2, 0, 1)) * 1  # 改变数据的shape(将action_fre*interest*3变为3*action_fre*interest)
overlay_data = overlay_data[np.newaxis, :]  # 插入一个新的维度(将三维数据3*action_fre*interest转成四维数据1*3*action_fre*interest)

exec_net, input_blob = get_net(model_blob)
res = exec_net.infer(inputs={input_blob: overlay_data})

# res = result['output']

res = np.squeeze(res)

print(res)
print(type(res))

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39

引用:

https://aistudio.baidu.com/aistudio/projectdetail/2358719

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/616576
推荐阅读
相关标签
  

闽ICP备14008679号