我正在尝试将一个模型从ONNX模型转换为TF模型,我面临以下问题
RuntimeError: Resize coordinate_transformation_mode=half_pixel and mode=nearest is not supported in Tensorflow.我得到onnx模型的最初模型来自MXNET。
代码片段:
import onnx
from onnx_tf.backend import prepare
onnx_model = onnx.load(onnx_file)
tf_rep = prepare(onnx_model, strict=True)
pb_path = "./weights/converted/exported.pb"
tf_rep.export_graph(pb_path)我在用:
tensorflow-addons 0.15.0
tensorflow-gpu 2.7.0
tensorflow-probability 0.15.0
onnx 1.10.2
onnx-tf 1.9.0
onnxruntime 1.10.0 有人知道如何解决这个问题吗?
编辑问题似乎来自这个mxnet层。
"op": "UpSampling",
"name": "rf_c3_upsampling",
"attrs": {
"num_args": "1",
"sample_type": "nearest",
"scale": "2",
"workspace": "512"发布于 2022-05-17 09:05:11
您可能需要更改插值()的参数。见这里的答案:Exception when converting Unet from pytorch to onnx
https://stackoverflow.com/questions/71131718
复制相似问题