• error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’


    最近安装caffe,突然报这个错:

    .build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::ImageDataParameter::set_mean_file(const char*)’:
    .build_release/src/caffe/proto/caffe.pb.h:17957:22: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
       if (mean_file_ == &::google::protobuf::internal::kEmptyString) {
                          ^
    .build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::ImageDataParameter::set_mean_file(const char*, size_t)’:
    .build_release/src/caffe/proto/caffe.pb.h:17964:22: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
       if (mean_file_ == &::google::protobuf::internal::kEmptyString) {
                          ^
    .build_release/src/caffe/proto/caffe.pb.h: In member function ‘std::string* caffe::ImageDataParameter::mutable_mean_file()’:
    .build_release/src/caffe/proto/caffe.pb.h:17971:22: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
       if (mean_file_ == &::google::protobuf::internal::kEmptyString) {
                          ^
    .build_release/src/caffe/proto/caffe.pb.h: In member function ‘std::string* caffe::ImageDataParameter::release_mean_file()’:
    .build_release/src/caffe/proto/caffe.pb.h:17978:22: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
       if (mean_file_ == &::google::protobuf::internal::kEmptyString) {
                          ^
    .build_release/src/caffe/proto/caffe.pb.h:17982:47: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
         mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
                                                   ^
    .build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::ImageDataParameter::set_allocated_mean_file(std::string*)’:
    .build_release/src/caffe/proto/caffe.pb.h:17987:22: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
       if (mean_file_ != &::google::protobuf::internal::kEmptyString) {
                          ^
    .build_release/src/caffe/proto/caffe.pb.h:17995:47: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
         mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
                                                   ^
    .build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::ImageDataParameter::clear_root_folder()’:
    .build_release/src/caffe/proto/caffe.pb.h:18054:24: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
       if (root_folder_ != &::google::protobuf::internal::kEmptyString) {
                            ^
    .build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::ImageDataParameter::set_root_folder(const string&)’:
    .build_release/src/caffe/proto/caffe.pb.h:18064:24: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
    发现又是protoc的版本不对。

    查了下:

    sensetime@sensetime-To-be-filled-by-O-E-M:/home/zenggq/mainspace/mscnn$ which protoc
    /usr/bin/protoc
    sensetime@sensetime-To-be-filled-by-O-E-M:/home/zenggq/mainspace/mscnn$

    sensetime@sensetime-To-be-filled-by-O-E-M:~/zenggq/caffe-bak$ pip show protobuf
    Name: protobuf
    Version: 3.3.0
    Summary: Protocol Buffers
    Home-page: https://developers.google.com/protocol-buffers/
    Author: protobuf@googlegroups.com
    Author-email: protobuf@googlegroups.com
    License: 3-Clause BSD License
    Location: /home/sensetime/anaconda2/lib/python2.7/site-packages
    Requires: six, setuptools
    sensetime@sensetime-To-be-filled-by-O-E-M:~/zenggq/caffe-bak$

    protoc --version

    发现是2.5.0

    索性把anaconda2下的protoc文件覆盖/usr/bin/protoc。

    搞定。

  • 相关阅读:
    Algs4-1.3链表实现泛型可迭代Stack
    Algs4-1.3链表实现科泛型可迭代Bag
    Algs4-1.3链表实现不定容泛型Queue不支持迭代
    Algs4-1.3不定容数组实现泛型栈支持迭代
    Algs4-1.3链表实现不定容泛型Stack不支持迭代
    Algs4-1.3不定容泛型栈(不可迭代)
    Algs4-1.3定容字符串栈
    Algs4-1.3定容泛型栈
    Algs4-1.3E.W.Dijkstra双栈算术表达式求值算法
    Algs4-1.2(非习题)可视化累加器
  • 原文地址:https://www.cnblogs.com/whu-zeng/p/7450105.html
Copyright © 2020-2023  润新知