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

Having trouble converting EfficientNetV2-B0 to IR Format

maryjo
Beginner
355 Views

I was training EfficientNetV2-B0 using this link: https://colab.research.google.com/github/google/automl/blob/master/efficientnetv2/tfhub.ipynb

 

Then I tried converting my model using the command below. Please help me I'm a beginner on this tool. Thanks

(openvino) C:\random\New folder\openvino\tools\mo>python mo_tf.py --input_model effnet.pb --input_shape [1,3,244,244]"
Model Optimizer arguments:
Common parameters:
- Path to the Input Model: C:\random\New folder\openvino\tools\mo\effnet.pb
- Path for generated IR: C:\random\New folder\openvino\tools\mo\.
- IR output name: effnet
- 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: [1,3,244,244]
- 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
TensorFlow specific parameters:
- Input model in text protobuf format: False
- Path to model dump for TensorBoard: None
- List of shared libraries with TensorFlow custom layers implementation: None
- Update the configuration file with input/output node names: None
- Use configuration file used to generate the model with Object Detection API: None
- Use the config file: None
OpenVINO runtime found in: C:\random\New folder\openvino\tools\mo\openvino
OpenVINO runtime version: 2022.1.0-7019-cdb9bec7210-releases/2022/1
Model Optimizer version: custom_HEAD_cdb9bec7210f8c24fde3e416c7ada820faaaa23e
[ 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.back.ConvolutionNormalizer.ConvolutionWithGroupsResolver'>)":
[ ERROR ] Traceback (most recent call last):
File "C:\random\New folder\openvino\tools\mo\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 "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\middle\pattern_match.py", line 46, in for_graph_and_each_sub_graph_recursively
func(graph)
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\back\ConvolutionNormalizer.py", line 166, in find_and_replace_pattern
V7ConvolutionWithGroupsResolver().find_and_replace_pattern(graph)
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\back\ConvolutionNormalizer.py", line 131, in find_and_replace_pattern
resolve_convolution_with_group(node, group, ir_version='V7')
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\back\ConvolutionNormalizer.py", line 31, in resolve_convolution_with_group
assert weights_shape[0] % group == 0
AssertionError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\main.py", line 533, in main
ret_code = driver(argv)
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\main.py", line 489, in driver
graph, ngraph_function = prepare_ir(argv)
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\main.py", line 407, in prepare_ir
graph = unified_pipeline(argv)
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\pipeline\unified.py", line 13, in unified_pipeline
class_registration.apply_replacements(graph, [
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\utils\class_registration.py", line 328, in apply_replacements
apply_replacements_list(graph, replacers_order)
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\utils\class_registration.py", line 314, in apply_replacements_list
apply_transform(
File "C:\random\New folder\openvino\tools\mo\openvino\tools\mo\utils\logger.py", line 112, in wrapper
function(*args, **kwargs)
File "C:\random\New folder\openvino\tools\mo\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.back.ConvolutionNormalizer.ConvolutionWithGroupsResolver'>)":

[ ERROR ] ---------------- END OF BUG REPORT --------------
[ ERROR ] -------------------------------------------------

0 Kudos
2 Replies
IntelSupport
Community Manager
327 Views

Hi Maryjo,

 

The --input_shape argument value must base on the order of dimensions and it depends on the framework input layout of a model. For a TensorFlow model the layout is [N,H,W,C].
 

I'm able to convert your model using the command below:

mo --input_model effnet.pb --input_shape [1,244,244,3] --reverse_input_channels

 

effnet_LI.jpg

 

 

Regards,

Aznie

 

0 Kudos
IntelSupport
Community Manager
305 Views

Hi Maryjo,


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