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.
6434 Discussions

Model Optimizer Scan failed on DL workbench

yimai
Employee
1,864 Views

Model Optimizer Scan failed as below. I converted googlenet-v1.caffemodel in Open model zoo public. 

---

Model Optimizer arguments:
Common parameters:
- Path to the Input Model: /home/workbench/.workbench/models/4/original/googlenet-v1.caffemodel
- Path for generated IR: /opt/intel/openvino_2022.1.0.643/tools/workbench/.
- IR output name: googlenet-v1
- Log level: ERROR
- Batch: Not specified, inherited from the model
- Input layers: Not specified, inherited from the model
- Output layers: Not specified, inherited from the model
- Input shapes: Not specified, inherited from the model
- Source layout: Not specified
- Target layout: Not specified
- Layout: Not specified
- Mean values: Not specified
- Scale values: Not specified
- Scale factor: Not specified
- Precision of IR: FP32
- Enable fusing: True
- User transformations: Not specified
- Reverse input channels: False
- Enable IR generation for fixed input shape: False
- Use the transformations config file: None
Advanced parameters:
- Force the usage of legacy Frontend of Model Optimizer for model conversion into IR: False
- Force the usage of new Frontend of Model Optimizer for model conversion into IR: False
Caffe specific parameters:
- Path to Python Caffe* parser generated from caffe.proto: /home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/utils/../front/caffe/proto
- Enable resnet optimization: True
- Path to the Input prototxt: /home/workbench/.workbench/models/4/original/googlenet-v1.prototxt
- Path to CustomLayersMapping.xml: /home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/utils/../../extensions/front/caffe/CustomLayersMapping.xml
- Path to a mean file: Not specified
- Offsets for a mean file: Not specified
OpenVINO runtime found in: /home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino
OpenVINO runtime version: 2022.1.0-7019-cdb9bec7210-releases/2022/1
Model Optimizer version: 2022.1.0-7019-cdb9bec7210-releases/2022/1
[ ERROR ] -------------------------------------------------
[ ERROR ] ----------------- INTERNAL ERROR ----------------
[ ERROR ] Unexpected exception happened.
[ ERROR ] Please contact Model Optimizer developers and forward the following information:
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID (<class 'openvino.tools.mo.load.caffe.loader.CaffeLoader'>)": Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
[ ERROR ] Traceback (most recent call last):
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/utils/class_registration.py", line 278, in apply_transform
for_graph_and_each_sub_graph_recursively(graph, replacer.find_and_replace_pattern)
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/middle/pattern_match.py", line 46, in for_graph_and_each_sub_graph_recursively
func(graph)
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/load/loader.py", line 14, in find_and_replace_pattern
self.load(graph)
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/load/caffe/loader.py", line 20, in load
caffe_pb2 = loader.import_caffe_pb2(argv.caffe_parser_path)
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/front/caffe/loader.py", line 24, in import_caffe_pb2
caffe_pb2 = importlib.import_module("caffe_pb2")
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/utils/../front/caffe/proto/caffe_pb2.py", line 32, in <module>
_descriptor.EnumValueDescriptor(
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 755, in __new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/main.py", line 533, in main
ret_code = driver(argv)
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/main.py", line 489, in driver
graph, ngraph_function = prepare_ir(argv)
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/main.py", line 407, in prepare_ir
graph = unified_pipeline(argv)
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/pipeline/unified.py", line 13, in unified_pipeline
class_registration.apply_replacements(graph, [
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/utils/class_registration.py", line 328, in apply_replacements
apply_replacements_list(graph, replacers_order)
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/utils/class_registration.py", line 314, in apply_replacements_list
apply_transform(
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/utils/logger.py", line 112, in wrapper
function(*args, **kwargs)
File "/home/workbench/.workbench/environments/1/lib/python3.8/site-packages/openvino/tools/mo/utils/class_registration.py", line 302, in apply_transform
raise Exception('Exception occurred during running replacer "{} ({})": {}'.format(
Exception: Exception occurred during running replacer "REPLACEMENT_ID (<class 'openvino.tools.mo.load.caffe.loader.CaffeLoader'>)": Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
[ ERROR ] ---------------- END OF BUG REPORT --------------
[ ERROR ] -------------------------------------------------

---

Labels (1)
0 Kudos
1 Solution
Hairul_Intel
Moderator
1,627 Views

Hi yimai,

Glad to know that you were able to infer the images successfully.

 

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

 

 

Regards,

Hairul


View solution in original post

0 Kudos
7 Replies
Hairul_Intel
Moderator
1,814 Views

Hi yimai,

Thank you for reaching out to us.

 

I've validated from my end using googlenet-v1 model and encountered similar errors when converting the model in OpenVINO DL Workbench 2022.1.

 

We are investigating this issue and in the meantime, I suggest you use openvino-dev python package in converting your models.

 

For your information, I was able to successfully convert googlenet-v1 model using openvino-dev[caffe] python package as shown below:

ov2022.png

 

 

 

Regards,

Hairul

 

0 Kudos
yimai
Employee
1,765 Views

Hi Hairul,

Thank you for your guidance to solve the issue. I tried to install openvino-dev but error ocurred as below. 

 

~$ pip install openvino-dev[caffe]
Collecting openvino-dev[caffe]
Using cached openvino_dev-2022.1.0-7019-py3-none-any.whl (5.8 MB)
ERROR: Could not find a version that satisfies the requirement openvino==2022.1.0 (from openvino-dev[caffe]) (from versions: 2021.3.0, 2021.4.0, 2021.4.1, 2021.4.2)
ERROR: No matching distribution found for openvino==2022.1.0 (from openvino-dev[caffe])

 

Regards

0 Kudos
Hairul_Intel
Moderator
1,740 Views

Hi yimai,

This error occurs due to outdated PIP version. You'll need to install the highest version of PIP as mentioned in Step 3. Set Up and Update PIP to the Highest Version before installing the OpenVINO™ Development Package.

 

To set up and update PIP to the highest version, run the following commands:

python -m pip install --upgrade pip

 

 

Regards,

Hairul


0 Kudos
yimai
Employee
1,694 Views

Hi,

Thank you for your support. I updated pip in openvino_env and successed to convert IR. But when I infered images on workbench, Erorrs ocurred as below. Can you identify the issue?  


[setupvars.sh] OpenVINO environment initialized
2022-07-13 13:04:50.248565: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/opt/intel/openvino_2022.1.0.643/extras/opencv/python/cv2/../../bin:/opt/intel/openvino/extras/opencv/lib:/opt/intel/openvino/tools/compile_tool:/opt/intel/openvino/runtime/3rdparty/tbb/lib::/opt/intel/openvino/runtime/3rdparty/hddl/lib:/opt/intel/openvino/runtime/lib/intel64::/opt/intel/openvino_2022.1.0.643/extras/opencv/python/cv2/../../bin:/opt/intel/openvino/extras/opencv/lib:/opt/intel/openvino/runtime/lib/intel64:/opt/intel/openvino/tools/compile_tool:/opt/intel/openvino/runtime/3rdparty/tbb/lib:/opt/intel/openvino/runtime/3rdparty/hddl/lib
2022-07-13 13:04:50.248606: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
/usr/local/lib/python3.8/dist-packages/defusedxml/__init__.py:30: DeprecationWarning: defusedxml.cElementTree is deprecated, import from defusedxml.ElementTree instead.
from . import cElementTree
[NEW STAGE] 1;1
[RUN COMMAND] "benchmark_app" -m "/home/workbench/.workbench/models/9/original/googlenet-v1.xml" -i "/home/workbench/.workbench/datasets/10" -d "CPU" -b "1" -nstreams "1" -t "20" --report_type "no_counters" --report_folder "/opt/intel/openvino_2022/tools/workbench/wb/data/profiling_artifacts/9/job_artifacts/1_1" -pc --exec_graph_path "/opt/intel/openvino_2022/tools/workbench/wb/data/profiling_artifacts/9/job_artifacts/1_1/exec_graph.xml"
[Step 1/11] Parsing and validating input arguments
[Step 2/11] Loading OpenVINO
[ WARNING ] PerformanceMode was not explicitly specified in command line. Device CPU performance hint will be set to THROUGHPUT.
[ INFO ] OpenVINO:
API version............. 2022.1.0-7019-cdb9bec7210-releases/2022/1
[ INFO ] Device info
CPU
openvino_intel_cpu_plugin version 2022.1
Build................... 2022.1.0-7019-cdb9bec7210-releases/2022/1
[Step 3/11] Setting device configuration
[Step 4/11] Reading network files
[ INFO ] Read model took 12.99 ms
[Step 5/11] Resizing network to match image sizes and given batch
[ INFO ] Network batch size: 1
[Step 6/11] Configuring input of the model
[ INFO ] Model input 'data' precision f32, dimensions ([N,H,W,C]): 1 3 224 224
[ INFO ] Model output 'prob' precision f32, dimensions ([...]): 1 1000
[Step 7/11] Loading the model to the device
[ INFO ] Compile model took 118.32 ms
[Step 8/11] Querying optimal runtime parameters
[ INFO ] DEVICE: CPU
[ INFO ] AVAILABLE_DEVICES , ['']
[ INFO ] RANGE_FOR_ASYNC_INFER_REQUESTS , (1, 1, 1)
[ INFO ] RANGE_FOR_STREAMS , (1,
[ INFO ] FULL_DEVICE_NAME , 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
[ INFO ] OPTIMIZATION_CAPABILITIES , ['WINOGRAD', 'FP32', 'FP16', 'INT8', 'BIN', 'EXPORT_IMPORT']
[ INFO ] CACHE_DIR ,
[ INFO ] NUM_STREAMS , 1
[ INFO ] INFERENCE_NUM_THREADS , 0
[ INFO ] PERF_COUNT , True
[ INFO ] PERFORMANCE_HINT_NUM_REQUESTS , 0
[Step 9/11] Creating infer requests and preparing input data
[ INFO ] Create 1 infer requests took 0.08 ms
[ INFO ] Prepare image /home/workbench/.workbench/datasets/10/0.jpg
[ WARNING ] Image is resized from ((612, 612)) to ((224, 3))
[ ERROR ] Image shape (3, 224, 3) is not compatible with input shape [1, 3, 224, 224]! Make sure -i parameter is valid.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/openvino/tools/benchmark/utils/inputs_filling.py", line 186, in get_image_tensors
images[b] = image
ValueError: could not broadcast input array from shape (3,224,3) into shape (3,224,224)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/openvino/tools/benchmark/main.py", line 375, in run
data_queue = get_input_data(paths_to_input, app_inputs_info)
File "/usr/local/lib/python3.8/dist-packages/openvino/tools/benchmark/utils/inputs_filling.py", line 113, in get_input_data
data[port] = get_image_tensors(image_mapping[info.name][:images_to_be_used_map[info.name]], info, batch_sizes_map[info.name])
File "/usr/local/lib/python3.8/dist-packages/openvino/tools/benchmark/utils/inputs_filling.py", line 188, in get_image_tensors
raise Exception(f"Image shape {image.shape} is not compatible with input shape {shape}! "
Exception: Image shape (3, 224, 3) is not compatible with input shape [1, 3, 224, 224]! Make sure -i parameter is valid.
[ INFO ] Statistics report is stored to /opt/intel/openvino_2022/tools/workbench/wb/data/profiling_artifacts/9/job_artifacts/1_1/benchmark_report.csv

 

0 Kudos
Hairul_Intel
Moderator
1,669 Views

Hi yimai,

I've validated from my end using converted googlenet-v1 IR model and encountered similar errors when incorrect input layout was used for the model in OpenVINO DL Workbench 2022.1.

 

The input layout for converted googlenet-v1 model is [B, C, H, W] where:

  • B - batch size
  • C - channel
  • H - height
  • W - width

 

Please ensure that you've selected the correct input layout which is [B, C, H, W] when importing the IR model as shown below:

input_layout.png

 

 

Regards,

Hairul

 

0 Kudos
yimai
Employee
1,647 Views

Hi,

Thank you for your support. I successed to infer images as below.

 

yimai_0-1657895860648.png

 

Regards

0 Kudos
Hairul_Intel
Moderator
1,628 Views

Hi yimai,

Glad to know that you were able to infer the images successfully.

 

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

 

 

Regards,

Hairul


0 Kudos
Reply