Mat转Tensor
img = cv::imread(img_path);
TensorShape shape({1, img.rows , img.cols, 3});
input_tensor = Tensor(tensorflow::DT_UINT8, shape);
uint8_t *p = input_tensor.flat<uint8_t>().data();
Mat fakeMat(img.rows, img.cols, cv::CV_8UC3, p);
img.convertTo(fakeMat, cv::CV_8UC3);
protobuf
原因:老版protobuf的头文件里找不到该定义,添加头文件路径tensorflow/contrib/makefile/downloads/protobuf/src/