tensorflow 模型训练
来源:互联网 发布:mac 建筑 软件 收费吗 编辑:程序博客网 时间:2024/05/16 00:40
因为我是android开发,所以用的是MobileNet模型库,linux系统
下载数据flower_photos
打开终端
下载完成后进入tensorflow源码文件夹
$ mkdir flowers
将flower_photos下有图片的文件夹都复制到flowers文件夹,flowers文件夹目录
daisy dandelion roses sunflowers tulips
开始训练
$ python tensorflow/examples/image_retraining/retrain.py --learning_rate=0.0001 --testing_percentage=20 --validation_percentage=20 --train_batch_size=32 --validation_batch_size=-1 --flip_left_right True --random_scale=30 --random_brightness=30 --eval_step_interval=100 --how_many_training_steps=600 --architecture mobilenet_1.0_224 --image_dir flowers/
会自动下载MobileNet模型库放入/tmp/imagenet内,再加一句--model_dir /xxx设置自己的模型库路径
嫌每次都打这么多代码麻烦到话,就改tensorflow/examples/image_retraining/retrain.py源码,根据标签改参数
生成的output_graph.pb和output_labels.txt文件在/tmp文件夹下
在android studio内使用时只需要改ClassifierActivity.java文件
private static final int INPUT_SIZE = 224;private static final int IMAGE_MEAN = 128;private static final float IMAGE_STD = 128;private static final String INPUT_NAME = "input:0";private static final String OUTPUT_NAME = "final_result";private static final String MODEL_FILE = "file:///android_asset/output_graph.pb";private static final String LABEL_FILE = "file:///android_asset/output_labels.txt";本来想用inception_v3的,可是训练好的库在android端无法使用
本文参考了
MobileNet教程:用TensorFlow搭建在手机上运行的图像分类器
- tensorflow 模型训练
- tensorflow 加载预训练模型
- tensorflow ssd mobilenet模型训练
- TensorFlow on Android:训练模型
- TensorFlow保存和加载训练模型
- tensorflow保存加载模型查看训练参数
- TensorFlow VGG-16 预训练模型
- TensorFlow保存和加载训练模型
- tensorflow将训练好的模型
- C++调用tensorflow 训练好的模型
- c++调用python训练的tensorflow模型
- 如何重新训练Tensorflow图像分类模型
- TensorFlow保存和加载训练模型
- TensorFlow在训练模型时指定GPU进行训练
- 将caffe训练好的模型转换为tensorflow模型
- Tensorflow入门2(模型训练,模型评估)
- Tensorflow加载预训练模型和保存模型
- keras基于theano和tensorflow训练的模型相互转换
- SparkSQL(下)--Spark实战应用
- Python NLP入门教程
- nova的pause instance的log
- java基础---------字符串常量池-创建了几个对象
- TCP/IP--ICMP和IGMP
- tensorflow 模型训练
- 51Nod-1618-树或非树
- 数据结构与算法--关键路径
- 文字一行显示,超出部分显示省略号
- js基础知识
- orcl 查询锁表 解锁
- 在串口禁止打印内核信息
- VUE 页面的跳转写法
- 字符串大小写转换及省略其中数字输出