Skip to content

TF/Keras clip gets converted to ONNX min->max instead of clip #2410

@Artoriuz

Description

@Artoriuz

Describe the bug
tf.clip_by_value gets converted to a sequence of min->max instead of clip.

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 18.04*): Ubuntu 24.04
  • TensorFlow Version: 2.19
  • Python version: 3.12
  • ONNX version (if applicable, e.g. 1.11*): 1.18.0

To Reproduce
Any call of clip seems to create the issue, it's not specific to one model.

Screenshots
Screenshot above shows how clip gets exported in the left against what it should probably look like in the right (correct version was exported from Torch).

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions