參考
https://hackernoon.com/creating-insanely-fast-image-classifiers-with-mobilenet-in-tensorflow-f030ce0a2991
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/image_retraining/retrain.py
https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/#0
https://www.tensorflow.org/tutorials/image_retraining
准備圖片
images/label1/1.jpg
/2.jpg
images/label2/1.jpg
/2.jpg
開始訓練,默認Inception v3 model
python 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=flower_photos
也可以使用其他模型
詳細參數查看
python retrain.py -h
使用訓練結果進行預測
參考https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/#5
這樣在訓練好的inception-2015-12-05數據基礎上
僅重新訓練最后一層
用較短的時間達到分類效果