#!/usr/bin/env sh
export PYTHONPATH=$PYTHONPATH:/home/run/YHS/caffe/mtcnn-caffe/12net
set -e
/home/run/YHS/caffe/caffe-ssd/build/tools/caffe train \
--solver=./solver.prototxt \
在运行上面的脚本时,发生了错误:
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.7.0 of the Protocol Buffer runtime library, but the installed version is 3.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/descriptor.pb.cc".)
原因可能是因为Linux系统中配置了多版本的caffe,而每个版本的caffe 的依赖又不一样,从而产生了冲突。
我直接抛弃了用脚本训练的方法,而直接在新的层的路径下直接用python来训练:
import sys
sys.path.append('./caffe/python')
import caffe
import caffe
caffe.set_device(0)
caffe.set_mode_gpu()
solver=caffe.SGDSolver('solver.prototxt')
solver.net.forward()
然后就不报错了