Fine-tuned Inception V3 output tensor shape

246 Views Asked by At

I was following the tutorial provided in Tensorflow Slim repository to fine-tune the InceptionV3 model with flowers dataset. I was able to go all the way to the end of the tutorial in terms of freezing the graph and utilizing it in my own code. However, I was under the impression the fine-tuning of the model with change the output tensor from (?, 1001) to (?, 5) shape. But the shape is still (?, 1001). Am I missing something here?

I was testing it out with the flowers dataset, but eventually my goal is to train a model with classes not present in the 1001 from ImageNet.

Any help is appreciated. Thanks.

1

There are 1 best solutions below

0
Avanish Shrestha On BEST ANSWER

The official documentation does not provide all the arguments required for exporting the inference graph. Switched from

$ python export_inference_graph.py \
  --alsologtostderr \
  --model_name=inception_v3 \
  --output_file=/tmp/inception_v3_inf_graph.pb

to

python3 export_inference_graph.py \
    --alsologtostderr \
    --model_name=inception_v3 \
    --train_dir=training/ \
    --dataset_dir=/tmp/flowers/ \
    --dataset_name=flowers \
    --output_file=/tmp/inception_v3_inf_graph.pb