fixed compilation errors with current caffe

fixed compilation errors with current caffe