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

OPENVINO convert TF ResNet-20 model assertion error

ZLIN5
New Contributor I
588 Views

Hello! I'm trying to convert my own TF ResNet-20 model using the model optimizer but I encountered this error:

0 <mo.graph.graph.NodeWrap object at 0x7fc38c0709e8> [ 1 32 16 16] [ 1 32 16 -1]

 

[ ERROR ]  -------------------------------------------------

[ ERROR ]  ----------------- INTERNAL ERROR ----------------

[ ERROR ]  Unexpected exception happened.

[ ERROR ]  Please contact Model Optimizer developers and forward the following information:

[ ERROR ]

[ ERROR ]  Traceback (most recent call last):

  File "/opt/intel/computer_vision_sdk_fpga_2018.3.343/deployment_tools/model_optimizer/mo/main.py", line 321, in main

    return driver(argv)

  File "/opt/intel/computer_vision_sdk_fpga_2018.3.343/deployment_tools/model_optimizer/mo/main.py", line 263, in driver

    mean_scale_values=mean_scale)

  File "/opt/intel/computer_vision_sdk_fpga_2018.3.343/deployment_tools/model_optimizer/mo/pipeline/tf.py", line 219, in tf2nx

    convert_batch_norm(graph)

  File "/opt/intel/computer_vision_sdk_fpga_2018.3.343/deployment_tools/model_optimizer/mo/middle/passes/fusing/decomposition.py", line 61, in convert_batch_norm

    _fused_batch_norm_decomposition(graph, tinput, toutput, const, beta, scale, shift, can_be_fused)

  File "/opt/intel/computer_vision_sdk_fpga_2018.3.343/deployment_tools/model_optimizer/mo/middle/passes/fusing/decomposition.py", line 96, in _fused_batch_norm_decomposition

    data_nodes=toutput)

  File "/opt/intel/computer_vision_sdk_fpga_2018.3.343/deployment_tools/model_optimizer/mo/ops/op.py", line 179, in create_node_with_data

    [np.array_equal(old_data_shape[id], data_node.shape) for id, data_node in enumerate(data_nodes)])

AssertionError

 

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

[ ERROR ]  -------------------------------------------------

 

The first line of the above error message is the info of the node that gave me this error. I attached my test script for conversion and the .pb file in the following link: https://drive.google.com/open?id=1uKyxnl0ty6wt_-KlYCAHIwbwqj5-mqkY

The .pb file runs well with the native TF python API for inference on GPU/CPU. Anyone could help? Thanks in advance!

0 Kudos
3 Replies
ZLIN5
New Contributor I
588 Views

The problem has been resolved. It's because the model I use uses channels_first as default for GPU training, while OPENVINO requires channels_last for TF models.

0 Kudos
Monique_J_Intel
Employee
588 Views

Glad to see you resolved your issue. I'll call this closed.

Kind Regards,

Monique Jones

0 Kudos
Chen__Bruce1
Beginner
588 Views

lin, zhongyi wrote:

The problem has been resolved. It's because the model I use uses channels_first as default for GPU training, while OPENVINO requires channels_last for TF models.

 

Zhongyi, how did you resolve this? 

0 Kudos
Reply