第一步一首先配置caffe_py3的环境(我配置在203上)
第二部:将文件mobileNetV2下载后放在/media/cbpm2016/E/duchao/caffe_py3/examples目录下MobileNet V2的Caffe模型:https://github.com/shicai/MobileNet-Caffe
第三步:修改配置文件目录:
train_fintune_mobilenet.sh中修改路径:
/media/cbpm2016/E/duchao/caffe_py3/build/tools/caffe train -solver //media/cbpm2016/E/duchao/caffe_py3/examples/mobileNetV2/solver.prototxt -weights /media/cbpm2016/E/duchao/caffe_py3/examples/mobileNetV2/mobilenet_v2.caffemodel 2>&1 | tee /media/cbpm2016/E/duchao/caffe_py3/examples/mobileNetV2/0403.log
具体修改可以参考:https://github.com/shicai/MobileNet-Caffe
solver.prototxt中修改:
test_iter:2791
test_interval: 1539
base_lr: 0.001
display: 20
max_iter: 64000
lr_policy: "multistep"
gamma: 0.1
device_id: 0
momentum: 0.9
weight_decay: 0.00001
snapshot: 1675
snapshot_prefix: "/media/cbpm2016/E/duchao/caffe_py3/examples/mobileNetV2/model/mobile_eye_517_"
solver_mode: GPU
net: "/media/cbpm2016/E/duchao/caffe_py3/examples/mobileNetV2/trainval_mobilenetV2.prototxt"
#net: "/media/cbpm2016/E/wanlei/project/python/classify/inception_finetune/trainval_mobilenetV2_0402.prototxt"
#net:"/media/cbpm2016/E/wanlei/project/python/classify/inception_finetune/resnet18_train.prototxt"
#net:"/media/cbpm2016/E/wanlei/project/python/classify/inception_finetune/trainval_resnet18-propagate_down.prototxt"
test_initialization: false
stepvalue: 10000
stepvalue: 20000
stepvalue: 48000
type: "Nesterov"
trainval_mobilenetV2.prototxt文件中修改路径
}
image_data_param {
source: "/media/cbpm2016/E/duchao/caffe_py3/examples/imagenet/sdg_data(224)/train.txt"
batch_size: 25
shuffle: true
}
image_data_param {
source: "/media/cbpm2016/E/duchao/caffe_py3/examples/imagenet/sdg_data(224)/val.txt"
batch_size: 1
}