'No schema registered' 在 ONNX 模型转换中

'No schema registered' in ONNX model conversion

我正在使用 kaggle 笔记本。我正在尝试使用 tensorflowJS 将我的 pytorch 模型转换为 tensorflow 模型 运行。我使用下面的代码将 onnx 模型转换为 tensorflow 模型-

import onnx
from onnx_tf.backend import prepare
 
onnx_model = onnx.load("../input/onnx-model/model.onnx")
tf_rep = prepare(onnx_model)
tf_rep.export_graph("output/model.pb")

我得到了

SchemaError: No schema registered for 'BitShift'!

我尝试使用 onnx 版本 1.8.1 、 1.8.0 ,然后进一步降级到 1.6.0 。

此外,我尝试 运行 onnx 直接使用 onnx.js 建模,但在图像规范化和调整大小方面面临问题。因此,我决定改用 tfjs。

我遇到了同样的问题。卸载 onnx-tf 和 运行 pip install git+https://github.com/onnx/onnx-tensorflow.git。问题似乎与某些异常类型有关。

我已经针对 tf-1.15.0 对其进行了测试,并将 onnx 降级 pip install onnx==1.8.0
有关更多详细信息,请使用 this answer