对于 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
对于 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
举报