Hello, I am trying to extract/print the model weight values after loading the network using ie.read_network().
I am using OpenVINO 2021.3 and loading Tiny YOLO4 weights. I have already tried these two methods as proposed in the Intel community forum.
But in both cases I am getting the following error:
AttributeError: 'openvino.inference_engine.ie_api.IENetwork' object has no attribute 'layers'
Any help regarding this is appreciated.
Usually, that kind of error means that you didn't properly link OpenVINO library/packages or that particular library mentioned actually does not exist(you didn't install).
The setupvars should link all required library for OpenVINO. That is why it is required to be run before running anything in the OpenVINO package.
The error could also mean that you didn't call a certain library/ function properly (especially if you are creating your own custom code).
This example is the simplest that could be used as a test: https://docs.openvinotoolkit.org/latest/openvino_inference_engine_ie_bridges_python_sample_hello_classification_README.html
You may study how this application is built and apply it to yours.
Thanks for the response. But when I remove that particular line where I am trying to print the layers' weights, then the entire code runs fine along with the inference. So, I am not sure what causes that issue.
Also, the two links I mentioned, use different methods for extracting the layers. Can you please point out which is the correct method as of version 2021.3? It will help me to figure some of my next steps a bit faster.
Definitely your "print the layers' weights" function has something wrong. Probably you are calling a variable/function that does not exist or could be something else. Anyway, the error that you get is related to the library linking as I had said previously.
Maybe the program tried to find the non-existent variable/function in the library and couldn't find it, thus giving out the error.
If you are trying to follow the link that you gave, at least you should be able to see the values as what that guy tried:
If yours is related to Quantization as the above link (which you gave previously), this is what you should study:
Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question.