OpenVINO开发小组
直播中

张丽

8年用户 1581经验值
私信 关注
[问答]

请问使用2022.2时是否可以读取模型OpenVINO™层?


  • 使用 2020.3 时,使用 net.layers 和 layers.blob 读取模型OpenVINO™层。
  • OpenVINO™自 2021.2 OpenVINO™起,使用 2022.2 作为 net.layers 和 layers.blob 时无法读取模型层。

回帖(1)

王龙

2025-3-6 14:16:24
对于 2022.2 OpenVINO™,模型图层的权重位于网络的常量运算中。
使用 get_data() 方法检索 2022.2 OpenVINO™ 中常量节点的权重值:
from openvino.inference_engine import IECore
import ngraph as ng
ie = IECore()
path_xml=".xml"
path_bin=".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
举报

更多回帖

发帖
×
20
完善资料,
赚取积分