Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Python API Error when reading network

MAG
Beginner
731 Views

Hello,

I just downloaded the latest version of OpenVino for Raspbian (https://download.01.org/opencv/2021/openvinotoolkit/2021.1/l_openvino_toolkit_runtime_raspbian_p_2021.1.110.tgz) and installed on a Rpi.

 

I followed all the instructions (https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_raspbian.html) and everything seems to work well. I also build the run the c++ Object detection sample and it works fine.

However, when I try running the Python samples, I am getting errors while trying to load the network.  Following is a sample of the errors and the command I am using.

python classification_sample.py -m ~/models/alexnet/FP16/alexnet.xml -i ~/images/car_1.bmp -d MYRIAD

[ INFO ] Creating Inference Engine
[ INFO ] Loading network files:
/home/pi/workspace/intel/models/alexnet/FP16/alexnet.xml
/home/pi/workspace/intel/models/alexnet/FP16/alexnet.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image /home/pi/workspace/intel/images/car_1.bmp is resized from (637, 749) to (227, 227)
[ INFO ] Batch size is 1
[ INFO ] Loading model to the plugin
Traceback (most recent call last):
File "classification_sample.py", line 124, in <module>
sys.exit(main() or 0)
File "classification_sample.py", line 88, in main
exec_net = ie.load_network(network=net, device_name=args.device)
File "ie_api.pyx", line 311, in openvino.inference_engine.ie_api.IECore.load_network
File "ie_api.pyx", line 320, in openvino.inference_engine.ie_api.IECore.load_network
RuntimeError: Check 'shape_size(inputs[0]->get_shape()) == shape_size(output_shape)' failed at ngraph/core/src/op/reshape.cpp:395:
While validating node 'v1::Reshape Reshape_1454 (Constant_1472[0]:f16{1,4096}, Constant_1453[0]:i64{1}) -> (f16{4096})' with friendly_name 'Reshape_1454':
Requested output shape Shape{4294967295} is incompatible with input shape Shape{1, 4096}

 

Can anybody help on how to help this issue?

Please note that I have also tried the 2020.4 release and I am getting similar errors.

 

Thanks in advance,

Marcelo

 

 

0 Kudos
3 Replies
IntelSupport
Moderator
708 Views

Hi,

Thanks for reaching out.

We are currently investigating this issue and will get back to you.


Regards,

Aznie


0 Kudos
Aznie_Intel
Moderator
693 Views

Hi Marcelo,

Sorry for the delay in replying to you. This is because, during the conversion of alexnet model into Intermediate Representation (IR), you need to specify the argument/flag in the command. Instead of converting the model using Model Optimizer, please use converter.py to convert the alexnet model into Intermediate Representative OpenVINO toolkit.

Here is the command using converter.py:

C:\Program Files (x86)\Intel\openvino_2021.1.110\deployment_tools\open_model_zoo\tools\downloader>converter.py --name=alexnet

 

Then, you can find the .xml and .bin file in C:\Program Files (x86)\Intel\openvino_2021.1.110\deployment_tools\tools\model_downloader\public\alexnet directory. If you want to know more regarding the require argument for the model, check out model.yml file in C:\Program Files (x86)\Intel\openvino_2020.3.194\deployment_tools\open_model_zoo\models\public\alexnet directory.

 

Regards,

Aznie

0 Kudos
IntelSupport
Moderator
670 Views

Hi Marcelo,

This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.


Regards,

Aznie


0 Kudos
Reply