如何将Onnx模型(.onnx)转换为Tensorflow(.pb)模型 [英] How to convert Onnx model (.onnx) to Tensorflow (.pb) model

查看:467
本文介绍了如何将Onnx模型(.onnx)转换为Tensorflow(.pb)模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将.onxx模型转换为.pb模型.我已经编写了代码,但出现错误:

I am trying to convert .onxx model to .pb model. I have written the code but i am getting error:

@tf_func(tf.ceil)AttributeError:模块'tensorflow'没有属性'ceil'

@tf_func(tf.ceil)AttributeError: module 'tensorflow' has no attribute 'ceil'

代码:

import onnx
from tensorflow.python.tools.import_pb_to_tensorboard import import_to_tensorboard
from onnx_tf.backend import prepare
onnx_model = onnx.load("original_3dlm.onnx")
tf_rep = prepare(onnx_model)
tf_rep.export_graph("model_var.pb")
import_to_tensorboard("model_var.pb", "tb_log")

如何解决此问题?还有其他方法可以将Onxx转换为Tensorflow吗?

How to resolve this issue? Is there any other way to convert Onxx to Tensorflow?

推荐答案

我以此解决了这个问题. 用于ONNX的Tensorflow后端. 如果您有任何问题,请告诉我. 从tensorflow 2.0更改为1.14.也许可以解决问题.

I solve this issue with this. Tensorflow Backend for ONNX. Let me know if you have any issue. Change from tensorflow 2.0 to 1.14.Maybe solve the problem.

这篇关于如何将Onnx模型(.onnx)转换为Tensorflow(.pb)模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆