将 TensorFlow 转换为 ONNX 失败:RFFT 或 FFT 的当前实现仅允许 ComplexAbs 作为消费者而不是 {'Imag', 'Real'}

问题描述 投票:0回答:0

我正在尝试将此 TensorFlow 模型 转换为 onnx。但是我收到一条错误消息:

> python -m tf2onnx.convert --saved-model .\spice --output model.onnx --opset 11 --verbose
...
2023-04-08 18:33:10,811 - ERROR - tf2onnx.tfonnx: Tensorflow op [Real: Real] is not supported
2023-04-08 18:33:10,812 - ERROR - tf2onnx.tfonnx: Tensorflow op [Imag: Imag] is not supported
2023-04-08 18:33:10,879 - ERROR - tf2onnx.tfonnx: Unsupported ops: Counter({'Real': 6, 'Imag': 6})
...
ValueError: make_sure failure: Current implementation of RFFT or FFT only allows ComplexAbs as consumer not {'Real', 'Imag'}

TensorFlow Light (tflight) 模型也是如此:

> python -m tf2onnx.convert --opset 16 --tflite .\lite-model_spice_1.tflite --output spice.onnx
...
ValueError: make_sure failure: Current implementation of RFFT or FFT only allows ComplexAbs as consumer not {'Imag', 'Real'}

我在 Windows 11、Python 3.10.10、TensorFlow 2.12 上

这是我第一次尝试使用 TensorFlow / ONNX,所以我不确定错误来自哪里。

问题

  • 跟TensorFlow、tf2onnx、模型有关系吗?
  • 它可以与其他设置一起使用(可能在 Linux 或其他 TF 版本上)吗?
  • 如何解决这个问题?
python tensorflow tensorflow-lite onnx tf2onnx
© www.soinside.com 2019 - 2024. All rights reserved.