Tuesday, March 26, 2019

Tensorflow Lite Demo

As part of my requirements, have started deploying tensorflow models on Android using Tensorflow Lite
Amazing experience



import tensorflow as tf
# Convert to TensorFlow Lite model.
converter = tf.lite.TFLiteConverter.from_keras_model_file('sunroof_model.h5')
tflite_model = converter.convert()
open("sunroof_model.tflite", "wb").write(tflite_model)

Below are few errors have experienced while developing android code

"Attempt to invoke virtual method 'void org.tensorflow.lite.Interpreter.run(java.lang.Object, java.lang.Object)' on a null object reference"
Cannot copy between a TensorFlowLite tensor with shape [1, 1] and a Java object with shape [1].
Cannot copy between a TensorFlowLite tensor with shape [1, 6] and a Java object with shape [6].

Friday, March 22, 2019

What are the contraints for tensorflow scope names?

While developing TF model, have faced the below issue



Solution: remove the spaces in the feature names

The kernel appears to have died. It will restart automatically

Got strange issue on my new setup
No module named 'numpy.core._multiarray_umath'

Solution: Just upgrade numpy