使用 OpenVINO™ 2022.2 時是否可以讀取模型的層?
內容類型: 疑難排解 | 文章 ID: 000092984 | 最近查看日期: 2023 年 11 月 20 日
對於 OpenVINO™ 2022.2,模型圖層的權重位於網路的常量操作中。
使用 get_data() 方法從 OpenVINO™ 2022.2 中的常量節點檢索權重值:
from openvino.inference_engine import IECore
import ngraph as ng
ie = IECore()
path_xml="<model_name>.xml"
path_bin="<model_name>.bin"
net = ie.read_network(model=path_xml, weights=path_bin)
func = ng.function_from_cnn(net)
ops = func.get_ops()
print(ops[14]) #Print the node attributes for the specific node index
print(ops[14].get_data()) #Specific Constant operations layer, all weights are located in the Constant operations