http://www.eecs.berkeley.edu/~lisa_anne/LRCN_video
作者用的是caffe。。
#!/bin/sh
TOOLS=../../build/tools
GLOG_logtostderr=1 $TOOLS/caffe train -solver singleFrame_solver_RGB.prototxt -weights caffe_imagenet_hyb2_wr_rc_solver_sqrt_iter_310000
echo 'Done.'
GLOG_logtostderr=1
设置glog日志。glog是google 出的一个C++轻量级日志库,介绍请看 glog
singleFrame_RGB的solver文件如下:
net: "train_test_singleFrame_RGB.prototxt"
test_iter: 75
test_state: { stage: 'test-on-test' }
test_interval: 100
base_lr: 0.001
lr_policy: "step"
gamma: 0.1
stepsize: 3000
display: 20
max_iter: 5000
momentum: 0.9
weight_decay: 0.005
snapshot: 5000
snapshot_prefix: "snapshots_singleFrame_RGB"
solver_mode: GPU
device_id: 0
random_seed: 1701
和RGB差不多啦。就是参数不一样。
#!/bin/sh
TOOLS=../../build/tools
GLOG_logtostderr=1 $TOOLS/caffe train -solver singleFrame_solver_flow.prototxt -weights caffe_imagenet_hyb2_wr_rc_solver_sqrt_iter_310000
echo 'Done.'
solver:
net: "train_test_singleFrame_flow.prototxt"
test_iter: 75
test_state: { stage: 'test-on-test' }
test_interval: 100
base_lr: 0.001
lr_policy: "step"
gamma: 0.1
stepsize: 20000
display: 20
max_iter: 50000
momentum: 0.9
weight_decay: 0.005
snapshot: 5000
snapshot_prefix: "snapshots_singleFrame_flow"
solver_mode: GPU
device_id: 1
random_seed: 1701
#!/bin/bash
TOOLS=../../build/tools
export HDF5_DISABLE_VERSION_CHECK=1
export PYTHONPATH=.
GLOG_logtostderr=1 $TOOLS/caffe train -solver lstm_solver_RGB.prototxt -weights single_frame_all_layers_hyb_RGB_iter_5000.caffemodel
echo "Done."
lstm模型是在single frame模型上继续训练的。
补全pythonpath,在makefile.config里面uncomment WITH_PYTHON_LAYER=1,Change the paths “flow_frames” and “RGB_frames” in “sequence_input_layer.py” as needed.
solver:
net: "train_test_lstm_RGB.prototxt"
test_iter: 100
test_state: { stage: 'test-on-test' }
test_interval: 100
base_lr: 0.001
lr_policy: "step"
gamma: 0.1
stepsize: 10000
display: 20
max_iter: 30000
momentum: 0.9
weight_decay: 0.005
snapshot: 5000
snapshot_prefix: "snapshots_lstm_RGB"
solver_mode: GPU
device_id: 0
random_seed: 1701
average_loss: 1000
clip_gradients: 5
#!/bin/bash
TOOLS=../../build/tools
export HDF5_DISABLE_VERSION_CHECK=1
export PYTHONPATH=.
#for debugging python layer
GLOG_logtostderr=1 $TOOLS/caffe train -solver lstm_solver_flow.prototxt -weights single_frame_all_layers_hyb_flow_iter_50000.caffemodel
echo "Done."
solver:
net: "train_test_lstm_flow.prototxt"
test_iter: 100
test_state: { stage: 'test-on-test' }
test_interval: 100
base_lr: 0.001
lr_policy: "step"
gamma: 0.1
stepsize: 20000
display: 20
max_iter: 70000
momentum: 0.9
weight_decay: 0.005
snapshot: 5000
snapshot_prefix: "snapshots_lstm_flow"
solver_mode: GPU
device_id: 0
random_seed: 1701
average_loss: 1000
clip_gradients: 15