跳到主要內容
支援知識庫

是否可以使用中間陳述 (IR) 實作OpenVINO™執行時間推斷管道?

內容類型: 產品資訊與文件   |   文章 ID: 000092935   |   最近查看日期: 2023 年 02 月 28 日

描述

  1. 將 TensorFlow* 模型轉換為 IR。
  2. 無法確定使用 IR 執行OpenVINO™執行時間推斷管道的步驟。

解決方法

  1. Create* OpenVINO™執行時間核心
    import openvino.runtime as ov
    core = ov.Core()

     
  2. 編譯 模型
    compiled_model = core.compile_model("model.xml", "AUTO")
     
  3. 建立 推斷要求
    infer_request = compiled_model.create_infer_request()
     
  4. 設置 輸入
    # Create tensor from external memory
    input_tensor = ov.Tensor(array=memory, shared_memory=True)
    # Set input tensor for model with one input
    infer_request.set_input_tensor(input_tensor)

     
  5. 開始 推理
    infer_request.start_async()
    infer_request.wait()

     
  6. 處理 推斷結果
    # Get output tensor for model with one output
    output = infer_request.get_output_tensor()
    output_buffer = output.data
    # output_buffer[] - accessing output tensor data

相關產品

本文章適用 3 產品。
Intel® Xeon Phi™ 處理器軟體 OpenVINO™ 工具套件 效能程式庫

免責聲明

此頁面上的內容是原始英文內容的人工和電腦翻譯的組合。此內容僅供您方便,僅供一般參考,不應被視為完整或準確。如果本頁面的英文版本與翻譯之間存在任何矛盾,則以英文版本為準。 查看此頁面的英文版本。