Is It Possible to Read Model’s Layer When Using OpenVINO™ 2022.2?
Content Type: Troubleshooting | Article ID: 000092984 | Last Reviewed: 11/20/2023
For OpenVINO™ 2022.2, the model layer's weights are located in the Constant operations of the network.
Use get_data() method to retrieve the weights value from Constant node in 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