tensorflow之准备好自己的train.txt和val.txt

来源:互联网 发布:淘宝手机客户端买家秀 编辑:程序博客网 时间:2024/04/30 16:49

   学习tensorflow时需要准备好自己的训练集train.txt 把训练图片给打上分类标签  和训练过程中的测试集val.txt 要给打上分类标签。

这样就需要你准备好train.txt和val.txt。怎样快速准备好自己的标签。可用shell脚本进行快速生成。

</pre><pre name="code" class="plain">#!/usr/bin/env shDATA=data/zhao/MY=examples/zhaofileecho "Create train.txt..."rm -rf $MY/train.txtfor i in 3 4 5 6 7 dofind $DATA/train -name $i*.jpg | cut -d '/' -f4-5 | sed "s/$/ $i/">>$MY/train.txtdoneecho "Create test.txt..."rm -rf $MY/test.txtfor i in 3 4 5 6 7dofind $DATA/test -name $i*.jpg | cut -d '/' -f4-5 | sed "s/$/ $i/">>$MY/test.txtdoneecho "All done"

用上这样的脚本就可以生成自己的标签。

0 1
原创粉丝点击