簡體   English   中英

OpenVino start_async 問題 - 指定的 request_id 不正確

[英]OpenVino start_async problem - Incorrect request_id specified

我正在嘗試運行測試以檢查 python 與 openvino-python 中同步和異步檢測之間的差異有多大,但我在使異步工作時遇到了一些問題。 當我嘗試在下面運行 function 時,來自 start_async 的錯誤顯示“指定的 request_id 不正確”。

def async_test(i):
    ie = IECore()

    net = ie.read_network(model=parameters['path_to_xml_file'], weights=parameters['path_to_bin_file'])

    exec_net = ie.load_network(network=net, device_name="CPU")

    input_image = cv2.imread(foto)

    batch = [input_image]

    input_image = preprocess_resize(batch, parameters["img_size"])

    input_image = np.moveaxis(input_image, 3, 1)

    input_layer = next(iter(net.inputs))

    for x in range(i):
        inference_res = exec_net.start_async(request_id=x, inputs={input_layer: input_image})
        inference_res.wait(0)

我嘗試查看一些 openvino 文檔,但找不到適合我的應用程序的任何內容。

因此,經過幾天的搜索,我發現您需要將 num_requests 參數放入 ie.load_network() 中,如下所示:

exec_net = ie.load_network(network=net, device_name="CPU", num_requests = x)

其中 x 是您要使用的 int 或更多請求。

出於某種原因,英特爾文檔中的任何地方都沒有提到它,只是因為英特爾論壇上的一些帖子才找到它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM