Tensorflow inception-v4 Classify Image -


i use tf-slim inception-v4 training model 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 new layers 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 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 this, got frozen_inception_v4.pb file.

for example https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/label_image/label_image.py input layer inception_v4 ? know how solve this?

that depends on particular implementation of slim used. define input , see name of tensor.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -