Tensorflow inception-v4 Classify Image

Home / Uncategorized / Tensorflow inception-v4 Classify Image

Question:
I use TF-slim inception-v4 training a model from scratch.
python train_image_classifier.py
–train_dir=${TRAIN_DIR}
–dataset_name=mydata
–dataset_split_name=train
–dataset_dir=${DATASET_DIR}
–model_name=inception_v4
–clone_on_cpu=true
–max_number_of_steps=1000
–log_every_n_steps=100

# Run evaluation.
python eval_image_classifier.py
–checkpoint_path=${TRAIN_DIR}
–eval_dir=${TRAIN_DIR}
–dataset_name=mydata
–dataset_split_name=validation
–dataset_dir=${DATASET_DIR}
–model_name=inception_v4
–batch_size=32

# # # Fine-tune all the new layers for 500 steps.
python train_image_classifier.py
–train_dir=${TRAIN_DIR}/all
–dataset_name=mydata
–dataset_split_name=train
–dataset_dir=${DATASET_DIR}
–model_name=inception_v4
–clone_on_cpu=true
–checkpoint_path=${TRAIN_DIR}
–max_number_of_steps=1000
–log_every_n_steps=100
–batch_size=32
–learning_rate=0.0001
–learning_rate_decay_type=fixed
–save_interval_secs=600
–save_summaries_secs=600
–optimizer=rmsprop
–weight_decay=0.00004

then freeze the graph:python export_inference_graph.py
–alsologtostderr
–model_name=inception_v4
–is_training=True
–labels_offset=999
–output_file=${OUTPUT_DIR}/unfrozen_inception_v4_graph.pb
–dataset_dir=${DATASET_DIR}

#NEWEST_CHECKPOINT=$(cat ${TRAIN_DIR}/all/checkpoint |head -n1|awk -F" ‘{print $2}’)
NEWEST_CHECKPOINT=$(ls -t1 ${TRAIN_DIR}/all|grep model.ckpt |head -n1)
echo ${NEWEST_CHECKPOINT%.*}
python ${OUTPUT_DIR}/tensorflow/tensorflow/python/tools/freeze_graph.py
–input_graph=${OUTPUT_DIR}/unfrozen_inception_v4_graph.pb
–input_checkpoint=${TRAIN_DIR}/all/${NEWEST_CHECKPOINT%.*}
–input_binary=true
–output_graph=${OUTPUT_DIR}/frozen_inception_v4.pb
–output_node_names=InceptionV4/Logits/Predictions
–input_meta_graph=True

After all this, I got a frozen_inception_v4.pb file.

for this example https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/label_image/label_image.py what is the input layer for inception_v4 ? Does anyone know how to solve this?


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *