6

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: module 'tensorflow' has no attribute 'ceil'

Code:

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")

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

halfer
  • 19,824
  • 17
  • 99
  • 186
Parag Jain
  • 612
  • 2
  • 14
  • 31

2 Answers2

5

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.

Zrufy
  • 423
  • 9
  • 22
1

your code as far as I can tell should be fine. The problem probably lies in the onnx-tf version you currently use. pip currently installs a version that only supports TensorFlow <= 1.15. run this in the terminal to install a more up-to-date version of onnx-tf.

pip uninstall onnx_tf
pip install git+https://github.com/onnx/onnx-tensorflow.git

refer to this issue for further details

DarQ
  • 92
  • 9