caffe小工具--一键make数据

原创
2017/02/09 17:58
阅读数 64

>>命令脚本 make_sample_data.cmd

@echo off
@setlocal EnableDelayedExpansion

set rootFolder=D:\Char\print_char\songti
set filename=chars

%collect samples%
set shuffle=True
set traintestRate=0.3

%convert image set%
set backend=lmdb
set resize_width=18
set resize_height=31
set shuffle=true
set check_size=true
% listFile should be contained two decript file for train and test;;example.txt.train example.txt.test ;;; but you do not need to specify ".train" or ".test"%
set listFile=%rootFolder%\%filename%.txt
set db_name=%rootFolder%\%filename%

%compute image mean%
set input_db=%db_name%
set output_file=%rootFolder%\%filename%

echo start collect samples...
python.exe collect_samples.py --shuffle=%shuffle% --traintestRate=%traintestRate% %rootFolder% %rootFolder%\%filename%.txt
echo start convert image set...
convert_imageset.exe --backend=%backend% --resize_width=%resize_width% --resize_height=%resize_height% --shuffle=%shuffle% --check_size=%check_size% %rootFolder% %listFile%.train %db_name%_train_%backend%
convert_imageset.exe --backend=%backend% --resize_width=%resize_width% --resize_height=%resize_height% --shuffle=%shuffle% --check_size=%check_size% %rootFolder% %listFile%.test %db_name%_test_%backend%
echo start compute image mean...
compute_image_mean.exe --backend=%backend% %input_db%_train_%backend% %output_file%_train_mean.binaryproto
compute_image_mean.exe --backend=%backend% %input_db%_test_%backend% %output_file%_test_mean.binaryproto
echo done!!!

 

>>命令脚本 caffe_train.cmd

echo off
set solver_prototxt=D:\Char\print_char\songti\lenet\lenet_solver.prototxt
set logfile=train.log
echo on
caffe.exe train --solver=%solver_prototxt% >%logfile%
pause

 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部