Skip to content

Get ValueError: node *** output needs to be rank 4, is 3 when trying to convert from TF model with Bidirectional ConvLSTM2D Layers #997

@TylerTheHumanCompiler

Description

@TylerTheHumanCompiler

Describe the bug
When trying to convert a tensorflow saved model which contains several Bidirectional ConvLSTM2D Layers with python -m tf2onnx.convert --saved-model ... I get the following error:

ValueError: node BiasAdd output needs to be rank 4, is 3

Urgency
Nope.

System information

  • Arch Linux
  • 2.2 & 2.5
  • Python 3.8

Model
This is the model I used (pastebin.com)

Terminal Output
Output from terminal (pastebin.com)

To Reproduce
Simply use
python -m tf2onnx.convert --saved-model /saved_model_dir --tag=serve --opset 10 --output /output_dir/model.onnx --continue_on_error
from a terminal on a model containing Bidirectional ConvLSTM2D Layers.

Expected behavior
Converting the saved model to onnx without errors.

Additional context
I tried using opset 11 & 12, and using --fold_const as option, but neither worked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions