TensorFlow Lite: Init node doesn't exist

Viewed 1760

I was trying to convert a model in a Keras file (.h5) to a TensorFlow Lite file (.tflite) using the following codes:

# Save model as .h5 keras file
keras_file = "eSleep.h5"
model_save = tf.keras.models.save_model(model,keras_file,overwrite=True,include_optimizer=True)

# Export keras file to TensorFlow Lite model
converter = tf.lite.TFLiteConverter.from_keras_model_file(keras_file)
tflite_model = converter.convert()
open("eSleep.tflite", "wb").write(tflite_model)

However, the following line:

tflite_model = converter.convert()

returned errors:

I tensorflow/core/grappler/devices.cc:53] Number of eligible GPUs (core count >= 8): 0 (Note: TensorFlow was not compiled with CUDA support)
I tensorflow/core/grappler/clusters/single_machine.cc:359] Starting new session
E tensorflow/core/grappler/grappler_item_builder.cc:636] Init node dense/kernel/Assign doesn't exist in graph

Can anybody help me to understand what does "Init node dense/kernel/Assign doesn't exist in graph" means and how to fix the error?

2 Answers

I solved the problem by using TensorFlow 1.12.

In my experience the converted model should work fine, even though this error is shown. You can ignore the error.

Related