zoukankan      html  css  js  c++  java
  • 使用tensorflow的retrain.py训练图片分类器

    参考

    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数据基础上

    仅重新训练最后一层

    用较短的时间达到分类效果

  • 相关阅读:
    iptables 学习
    linux frp 配置
    LINUX下安装TOMCAT 及JDK方法
    更改默认源pip
    重装ORACLE参考
    pandas入门学习
    python笔记
    redis 笔记
    STM32工程编译后TIM1时钟变慢的解决
    IAR工程编译错误问题
  • 原文地址:https://www.cnblogs.com/antflow/p/7256903.html
Copyright © 2011-2022 走看看