Issue
I use transfer learning with MobileNet to solve an image problem. I loaded the images with ImageDataGenerator (rescale=1./127.5)
.
After training I converted it with:
tensorflowjs_converter --input_format=tf_saved_model --weight_shard_size_bytes 10000000000 model tmp
The next step is to load my model and my weight file in my Expo App:
const model = await tf.loadGraphModel(bundleResourceIO(modelJson,modelWeight));
And normalize my input image:
const normalized = imageTensor.toFloat().sub(127.5).div(127.5);
The output is completely wrong (One class always 1 and all other ~0)
Does anybody know what the problem could be?
Solution
Solved it with this normalization:
const normalized = imageTensor.toFloat().sub(127).div(128);
Answered By - Mare Seestern
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.