Open PohSayKeong opened 6 years ago
I came with the same issue when trying to convert my Keras model to a TF one
@iamNCJ Hell NCJ , Could you please provide me with more hints how you fixed this issue ??
@Junhyuk Sure
I trained my Keras model from the Inception v3, and converted it into a tf one. Then, I checked the output and input layer of my new model and replaced the names in the Android code with mine. After that, I modified the parameters in the predict()
Bitmap resized_image = ImageUtils.processBitmap(bitmap,299);
//Normalize the pixels
floatValues = ImageUtils.normalizeBitmap(resized_image,299,128,128.0f); // changed for Inception V3
//Pass input into the tensorflow
tf.feed(INPUT_NAME,floatValues,1,299,299,3);
But all these changes are for my model, so you have to change these parameters to fit yours. Hope these are useful to you.
Hi I followed the guide and converted keras model to android but the prediction is always 100% for one class.
Code used to train model
Code used to convert to Tensorflow pb file:
Android side code can be found in this repository: https://github.com/Cragios/AICare