将IR加载到插件时,ssd_resnet50模型卡住了

时间:2019-03-05 17:41:56

标签: python object-detection-api openvino

我试图使用MYRIAD和Python API在NCS2上运行SSD ResNet50 FPN COCOssd_resnet50_v1_fpn_shared_box_predictor_640x640_coco14_sync_2018_07_03)模型,但是在将IR加载到插件时出现以下错误,它卡住了。

E: [xLink] [     80143] handleIncomingEvent:240 handleIncomingEvent() Read failed -4

E: [xLink] [     80143] dispatcherEventReceive:308  dispatcherEventReceive() Read failed -4 | event 0x7f35137fde80 USB_WRITE_REQ

E: [xLink] [     80143] eventReader:256 eventReader stopped
E: [xLink] [     80144] dispatcherEventSend:908 Write failed event -4

E: [watchdog] [     81144] sendPingMessage:164  Failed send ping message: X_LINK_ERROR
E: [watchdog] [     82144] sendPingMessage:164  Failed send ping message: X_LINK_ERROR
E: [watchdog] [     83144] sendPingMessage:164  Failed send ping message: X_LINK_ERROR
E: [watchdog] [     84145] sendPingMessage:164  Failed send ping message: X_LINK_ERROR

...

Failed send ping message: X_LINK_ERROR一直显示,直到我按ctrl + C杀死脚本为止。我注意到错误中的USB_WRITE_REQ,所以我认为它与USB3端口有关,但是当我尝试较轻的型号ssd_mobilenet_v2_coco时,它就像一个魅力。

这是生成IR(成功生成IR)的脚本

python mo_tf.py --input_model ~/workspace/pi/ssd_resnet50_v1_fpn_shared_box_predictor_640x640_coco14_sync_2018_07_03/frozen_inference_graph.pb --output_dir ~/workspace/pi/ssd_resnet50_v1_fpn_shared_box_predictor_640x640_coco14_sync_2018_07_03/openvino_model/FP16 --tensorflow_use_custom_operations_config ~/intel/computer_vision_sdk/deployment_tools/model_optimizer/extensions/front/tf/ssd_v2_support.json --tensorflow_object_detection_api_pipeline_config ~/workspace/pi/ssd_resnet50_v1_fpn_shared_box_predictor_640x640_coco14_sync_2018_07_03/pipeline.config --data_type FP16

这是我用来测试的脚本

python test.py -m ~/workspace/pi/ssd_resnet50_v1_fpn_shared_box_predictor_640x640_coco14_sync_2018_07_03/openvino_model/FP16/frozen_inference_graph.xml -i ~/workspace/object-detection/test_images/image.jpg -d MYRIAD

这是Python脚本的片段

plugin = IEPlugin(device=args.device, plugin_dirs=args.plugin_dir)
if args.cpu_extension and 'CPU' in args.device:
    plugin.add_cpu_extension(args.cpu_extension)
# Read IR
log.info("Reading IR...")
net = IENetwork(model=model_xml, weights=model_bin)

if plugin.device == "CPU":
    supported_layers = plugin.get_supported_layers(net)
    not_supported_layers = [l for l in net.layers.keys() if l not in supported_layers]
    if len(not_supported_layers) != 0:
        log.error("Following layers are not supported by the plugin for specified device {}:\n {}".
                  format(plugin.device, ', '.join(not_supported_layers)))
        log.error("Please try to specify cpu extensions library path in demo's command line parameters using -l "
                  "or --cpu_extension command line argument")
        sys.exit(1)
assert len(net.inputs.keys()) == 1, "Demo supports only single input topologies"
assert len(net.outputs) == 1, "Demo supports only single output topologies"
input_blob = next(iter(net.inputs))
out_blob = next(iter(net.outputs))

n, c, h, w = net.inputs[input_blob].shape

log.info("Loading IR to the plugin...")
exec_net = plugin.load(network=net) # <== stuck at this line

我能想到ssd_mobilenet_v2_coco_2018_03_29起作用而ssd_resnet50_v1_fpn_shared_box_predictor_640x640_coco14_sync_2018_07_03不起作用的唯一原因是前者的大小为33MB,后者为100MB。我认为SSD Resnet50型号可能已达到我的笔记本电脑资源限制。如果这是原因,我该如何解决?我在Ubuntu 18.04上使用l_openvino_toolkit_p_2018.5.455

SSD ResNet50 FPN COCO模型来自TensorFlow对象检测模型Zoo,并受Openvino工具包(https://software.intel.com/en-us/articles/OpenVINO-Using-TensorFlow)支持。

1 个答案:

答案 0 :(得分:0)

MYRIAD当前不支持此模型,开发团队已知道此问题。我们将在支持时为您提供更新。