keras-onnx icon indicating copy to clipboard operation
keras-onnx copied to clipboard

'KerasTensor' object has no attribute 'graph'

Open hexate opened this issue 4 years ago • 1 comments
trafficstars

I am having an issue when trying to convert my model to onnx.

I see this error: 'KerasTensor' object has no attribute 'graph'

while trying to run this: onnx_model = keras2onnx.convert_keras(model, model.name)

It worked fine with tf 2.3, but it was running on CPU. I upgraded to tf 2.5, and the model trains on GPU now, but my script fails when trying to export to Onnx. I am working with an LSTM model.

versions: Python: 3.8.10 (default, May 19 2021, 13:12:57) [MSC v.1916 64 bit (AMD64)] Tensorflow Gpu Version: 2.5.0 Keras Version: 2.5.0 Hub Version: 0.12.0 Datasets Version: 4.3.0 cuDNN version: 64_8 Cuda version: 64_112

hexate avatar Jun 08 '21 15:06 hexate

Same here. I used TF v2.3 instead of v2.5, that solved the issue but now I cannot use the GPU...

LaCandela avatar Jun 09 '21 13:06 LaCandela