Skip to content

Pool>Project>Reshape layer stack produces frozen dimensions on export with PyTorch #22102

@DLumi

Description

@DLumi

For some reason, when used with unfixed/symbolic shapes, the combination of AveragePooling2D, Conv2D, and Reshape causes PyTorch's tracer to freeze dimensions, making the export with unfixed shapes impossible. If the dims are marked as static, the export will go through.
I believe, this is a Keras-side issue as an identical model in pure Pytorch will be converted just fine, retaining the unfixed nature of the dimensions.

Colab to reproduce:
https://colab.research.google.com/drive/1VGox3Uw4RrcPDSlcgHIMZgBz_JYEjIRm

P.S. here I use a pure call to torch.onnx.export as the Keras wrapper is being fixed at this moment: #22076

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions