Community
cancel
Showing results for 
Search instead for 
Did you mean: 
tang__chu
Beginner
426 Views

Question about Sample Code: Python - OpenVINO™ Toolkit

hello:
I read and use the sample code: Python - OpenVINO™ Toolkit from: https://software.intel.com/en-us/articles/transitioning-from-intel-movidius-neural-compute-sdk-to-op...
in line32: req_handle = exec_net.start_async(inputs={input_blob: image}), when I run this statement, showed parameter error, then I changed it to:  req_handle =  exec_net.start_async(0,inputs={input_blob: image}), but still wondering what is the mean about exec_net.start_async?

0 Kudos
3 Replies
Hyodo__Katsuya
Innovator
426 Views

@tang, chu Inference of asynchronous reasoning. "0" represents the request number. By using the request number of "0" - "3" cyclically, you can direct inference more efficiently. - For example exec_net.start_async(request_id=0, inputs={self.input_blob: img1}) exec_net.start_async(request_id=1, inputs={self.input_blob: img2}) exec_net.start_async(request_id=2, inputs={self.input_blob: img3}) exec_net.start_async(request_id=3, inputs={self.input_blob: img4}) exec_net.requests[0].wait(-1) outputs = self.exec_net.requests[0].outputs exec_net.requests[1].wait(-1) outputs = self.exec_net.requests[1].outputs exec_net.requests[2].wait(-1) outputs = self.exec_net.requests[2].outputs exec_net.requests[3].wait(-1) outputs = self.exec_net.requests[3].outputs
Soni__Neha
Beginner
426 Views

Hi @Hyodo, Katsuya, I am trying to do Async inferecing for 3 models at a time for a single video/live stream.I am using this code of line -- res1 = exec_net1.start_async(request_id=0,inputs={input_blob1: leftEye_roi}) res1.wait(-1) res2 = exec_net2.start_async(request_id=0,inputs={input_blob2: rightEye_roi}) res2.wait(-1) res3 = exec_net3.start_async(request_id=0,inputs={input_blob3: mouth_roi}) res3.wait(-1) But I am getting this error at console-- Traceback (most recent call last): File "code.py", line 409, in sys.exit(main() or 0) File "code.py", line 343, in main res1 = exec_net1.start_async(request_id=1,inputs={input_blob1: leftEye_roi}) File "ie_api.pyx", line 246, in openvino.inference_engine.ie_api.ExecutableNetwork.start_async ValueError: Incorrect request_id specified! Please do needful.
Shubha_R_Intel
Employee
426 Views

Dear Soni, Neha,

Please study the following code for proper handling of current_request_id and next_request_id:

https://github.com/opencv/open_model_zoo/blob/master/demos/python_demos/object_detection_demo_yolov3...

If you should have further questions please don't hesitate to ask.

Thanks,

Shubha

 

Reply