Same predictions for any input for fine tuned inception v3 model
I am trying to fine tune an inception v3 model with 2 categories . These are the steps i followed
- created sharded files from custom data using build_image_data.py by changing the number of classes and examples in imagenet_data.py . Used a labelsfile.txt ;
- changed the values accordingly in flowers_data.py and using flowers_train.py I trained the model. ;
- I froze the model and got protobuf file. using this script;
- My input node (x) expects a batch of size 32 and size 299x299x3 so I hacked my way by duplicating my test image 32 times and created an input batch ;
- using input&output nodes, input batch and the script below, I am able to print the scores of predictions using the below script
image_data = create_test_batch(args.image_name) graph=load_graph(args.frozen_model_filename) x = graph.get_tensor_by_name('prefix/batch_processing/batch_join:0') y = graph.get_tensor_by_name('prefix/tower_0/logits/predictions:0') with tf.Session(graph=graph) as sess: y_out=sess.run(y, feed_dict={x:image_data}) print(y_out)
I got the result which looks like:
[ 0.02264258 0.16756369 0.80979371] [ 0.02351799 0.16782859 0.80865341].... [ 0.02205461 0.1794569 0.7984885 ] [ 0.02153662 0.16436867 0.81409472]
For any image as input, I have been getting the maximum score only in column 3 which means I'd get the same prediction for any input.
Is there any point which I am missing in my process ? Can anyone help me with this issue? I am using python 2.7 in ubuntu 16.04 in cloudVM
This question is better asked on StackOverflow since it is not a bug or feature request. There is also a larger community that reads questions there. Thanks!