openvinotoolkit / open_model_zoo

Pre-trained Deep Learning models and demos (high quality and extremely fast)
https://docs.openvino.ai/latest/model_zoo.html
Apache License 2.0
4.1k stars 1.37k forks source link

Two models in a neural compute stick2 #567

Closed aub8016 closed 5 years ago

aub8016 commented 5 years ago

in the multi camera multi person tracking, we need to use two models the person detection and re-identification model, but when using MYRIAD as a device it only loads one model and it gives the following error

INFO:root:Opening` file video1.mp4
INFO:root:Opening file video2.mp4
INFO:root:Creating Inference Engine
INFO:root:Loading network files:
    /home/ayoub/AI/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP16/person-detection-retail-0013.xml
    /home/ayoub/AI/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP16/person-detection-retail-0013.bin
INFO:root:Preparing input blobs
INFO:root:Loading model to the plugin
INFO:root:Creating Inference Engine
INFO:root:Loading network files:
    /home/ayoub/AI/open_model_zoo/tools/downloader/intel/person-reidentification-retail-0079/FP16/person-reidentification-retail-0079.xml
    /home/ayoub/AI/open_model_zoo/tools/downloader/intel/person-reidentification-retail-0079/FP16/person-reidentification-retail-0079.bin
INFO:root:Preparing input blobs
INFO:root:Loading model to the plugin
Traceback (most recent call last):
  File "multi_camera_multi_person_tracking.py", line 148, in <module>
    main()
  File "multi_camera_multi_person_tracking.py", line 140, in main
    person_recognizer = VectorCNN(args.m_reid, args.device)
  File "/home/ayoub/AI/open_model_zoo/demos/python_demos/multi_camera_multi_person_tracking/utils/network_wrappers.py", line 75, in __init__
    self.net = load_ie_model(model_path, device, None, num_reqs=self.max_reqs)
  File "/home/ayoub/AI/open_model_zoo/demos/python_demos/multi_camera_multi_person_tracking/utils/ie_tools.py", line 96, in load_ie_model
    exec_net = ie.load_network(network=net, device_name=device, num_requests=num_reqs)
  File "ie_api.pyx", line 85, in openvino.inference_engine.ie_api.IECore.load_network
  File "ie_api.pyx", line 92, in openvino.inference_engine.ie_api.IECore.load_network
RuntimeError: Can not init Myriad device: `NC_ERROR
vladimir-dudnik commented 5 years ago

@aub8016 thanks for report, I can confirm your finding. You can load two models into NCS2 stick but you need to have one instance of IECore for those models. This sample was created not following to this rule and it creates new IECore instance for every model. In that case, the first instance will acquire NCS2 device and second instance will not be able to find NCS2 device available, That's why it reports that IECore can't initialize Myriad device. If you will add one more stick to your system, sample will work. We'll fix that for the next release.

aub8016 commented 5 years ago

@vladimir-dudnik thank you for answer

IRDonch commented 5 years ago

This should be fixed by #582. @aub8016 Could you test with the version of the demo from the develop branch and see if the issue no longer occurs?

vladimir-dudnik commented 5 years ago

@IRDonch I've tested this PR on local system with NCS2 stick. Demo can work now.

IRDonch commented 5 years ago

Alright then, closing.