Open gggh000 opened 2 years ago
Please note Keras != Tensorflow. onnx-tf converts to Tensorflow, not Keras. tf_rep allows you to run an onnx model in Tensorflow environment. And there is CLI to convert and save an onnx model as a Tensorflow saved model, as described here, https://github.com/onnx/onnx-tensorflow/blob/master/doc/CLI.md
I did not say keras = tflow, where I did say that? I was not interested in cmd looking tool rather I was looking to use model structure in the tf. I am not exactly clear on what you mean by tf_rep running on tf environment.
Great to clarify Keras != Tensorflow. tf_rep running in TF environment means it is using TF APIs to execute the converted onnx model.
https://github.com/onnx/tutorials/blob/master/tutorials/OnnxTensorflowImport.ipynb Inspecting the code, it does not really import to tensorflow, not even sure why it is called importing to tf. the imported so cald tf_rep appears to be onnx's own stuff. does not fit into keras model https://www.tensorflow.org/api_docs/python/tf/keras/Model
Traceback (most recent call last): print("Loading onnx model...") model_import = onnx.load('output/p297.onnx') model = prepare(model_import) ... File ".py", line 68, in model.evaluate(X_test, y_test) AttributeError: 'TensorflowRep' object has no attribute 'evaluate'
I wondered if there is a dedicatd keras converstion but pitifully https://github.com/onnx/tutorials has conversion from onnx to keras but scoring section has none.