1.训练
(1)从头开始训练
./build/tools/caffe train -solver=examples/hands/hands_solver.prototxt -log_dir=examples/hands
(2)利用snapshot继续训练
./build/tools/caffe train -solver=examples/hands/hands_solver.prototxt -snapshot= examples/hands/hands_iter_5000.solverstate
(3)用预先训练好的权重来fine-tuning模型,需要一个caffemodel,不能和-snapshot同时使用
./build/tools/caffe train -solver= examples/hands/hands_solver.prototxt -weights= examples/hands/hands_iter_5000.caffemodel
2.测试
./build/tools/caffe test -model=examples/hands/hands_test.prototxt -weights= examples/hands/hands_iter_10000.caffemodel -gpu=0 -iterations=100
3.显示时间
./build/tools/caffe time -model= examples/hands/hands_train_test.prototxt -gpu=0
这个例子用来在屏幕上显示lenet模型用gpu迭代50次所使用的时间。
4.video-caffe 提取特征
## params
# test.prototxt
# model file
# id of gpu
# batch_size
# mini_batch_num
# prefix file 一定要自己写!!!例子中有格式,不写会提取到0个特征!!
# target feature
./build/tools/predict.bin examples/hands/hands_test.prototxt examples/hands/hands_iter_25.caffemodel 0 16 19 examples/hands/prefix.txt fc8