きゃまメモ

(自分用のメモであったり、何かしらアップしたり)

tensorflowのチュートリアルをやってみる

2018.06.09
tensorflow

参考(感謝)

https://www.tensorflow.org/tutorials/image_retraining

https://qiita.com/Kiro02/items/851a6b3f5cad37d77875

学習と判定のコマンドは以下

python3 retrain.py --bottleneck_dir=bottlenecks --how_many_training_steps=500 --model_dir=inception --summaries_dir=training_summaries/basic --output_graph=retrained_graph.pb --output_labels=retrained_labels.txt --image_dir=dataset
python3 label_image.py --image ./dataset/dog/0.jpg --graph ./retrained_graph.pb --labels ./retrained_labels.txt

label_image.pyを修正しないと動かなかった

$ diff label_image.py label_image.py.bk 
84,87c84,85
<   #input_layer = "input"
<   input_layer = "Placeholder"
<   #output_layer = "InceptionV3/Predictions/Reshape_1"
<   output_layer = "final_result"
---
>   input_layer = "input"
>   output_layer = "InceptionV3/Predictions/Reshape_1"
89d86
<   #parser = argparse.Argumentparser()
134d130
<   #with tf.session(graph=graph) as sess: