Article ID: 000059508 Content Type: Product Information & Documentation Last Reviewed: 05/20/2022

Unable to Infer the Shape of Connection Temporal Classification (CTC) GreedyDecoder in TensorFlow*


OpenVINO™ toolkit does not support the CTC layer.

  1. Ran model optimizer on two tensorflow model that contains a CTC layer which are ctc_greedy_decoder and tf.keras.backend.ctc_decode
  2. Both failed with the error: [ ERROR ] Cannot infer shapes or values for node "StatefulPartitionedCall/model_1/plate2_/CTCGreedyDecoder" and [ ERROR ] Batch dimensions of input tensors must be the same for StatefulPartitionedCall/model_1/plate2_/CTCGreedyDecoder node.
  3. Tried with and without explicit input shape definition and got the same result.

According to Supported Framework Layers documentation, the CTC layer is not supported in the OpenVINO toolkit.

Additional information

Follow the step below to decode the network output with the CTC layer.

  1. The CTCGreedyDecoder performs greedy decoding on the logics given in input (best path) in Tensorflow and it works best from the OpenVINO pre-trained model text_recognition_0012 as it was developed using the source framework of Tensorflow.
  2. CTCGreedyDecoder is an available tool for decoding purposes, thus it shall be applied after using the network output itself.
  3. For example, when using Text Detection C++ Demo with -b parameter on text-recognition-0012 model. If the default value is 0, CTC greedy decoder will be used.

Related Products

This article applies to 2 products