2016-07-15 16 views
0

Ich versuche dienen Beispiele zu replizieren tensorflow von https://tensorflow.github.io/serving/serving_advanced.htmlTensorflow Serving bazel Build Fehler: mnist_inference_2.cc - Signatures' wurde nicht erklärt

Aber ich folgende Fehlermeldung erhalten. Es ist möglicherweise Tensorflow-Bibliotheksfehler. Jede Hilfe wird sehr geschätzt.

: 

~/serving$ bazel build //tensorflow_serving/example:mnist_inference_2 
INFO: Found 1 target... 
ERROR: /home/ubuntu/serving/tensorflow_serving/session_bundle/BUILD:125:1: C++ compilation of rule '//tensorflow_serving/session_bundle:session_bundle' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -iquote . ... (remaining 103 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1. 
In file included from ./tensorflow_serving/session_bundle/session_bundle.h:30:0, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
./tensorflow_serving/session_bundle/signature.h:40:22: error: 'Signatures' has not been declared 
         Signatures* signatures); 
        ^
./tensorflow_serving/session_bundle/signature.h:43:28: error: 'Signatures' does not name a type 
Status SetSignatures(const Signatures& signatures, 
          ^
./tensorflow_serving/session_bundle/signature.h:43:40: error: ISO C++ forbids declaration of 'signatures' with no type [-fpermissive] 
Status SetSignatures(const Signatures& signatures, 
             ^
./tensorflow_serving/session_bundle/signature.h:51:5: error: 'ClassificationSignature' has not been declared 
    ClassificationSignature* signature); 
    ^
./tensorflow_serving/session_bundle/signature.h:58:5: error: 'ClassificationSignature' has not been declared 
    ClassificationSignature* signature); 
    ^
./tensorflow_serving/session_bundle/signature.h:64:31: error: 'RegressionSignature' has not been declared 
           RegressionSignature* signature); 
          ^
./tensorflow_serving/session_bundle/signature.h:73:32: error: 'ClassificationSignature' does not name a type 
Status RunClassification(const ClassificationSignature& signature, 
           ^
./tensorflow_serving/session_bundle/signature.h:73:57: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive] 
Status RunClassification(const ClassificationSignature& signature, 
                 ^
./tensorflow_serving/session_bundle/signature.h:83:28: error: 'RegressionSignature' does not name a type 
Status RunRegression(const RegressionSignature& signature, const Tensor& input, 
          ^
./tensorflow_serving/session_bundle/signature.h:83:49: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive] 
Status RunRegression(const RegressionSignature& signature, const Tensor& input, 
               ^
./tensorflow_serving/session_bundle/signature.h:90:28: error: 'GenericSignature' has not been declared 
          GenericSignature* signature); 
          ^
./tensorflow_serving/session_bundle/signature.h:94:28: error: 'Signature' has not been declared 
          Signature* default_signature); 
          ^
./tensorflow_serving/session_bundle/signature.h:100:26: error: 'Signature' has not been declared 
          Signature* default_signature); 
         ^
./tensorflow_serving/session_bundle/signature.h:106:32: error: 'GenericSignature' does not name a type 
Status BindGenericInputs(const GenericSignature& signature, 
           ^
./tensorflow_serving/session_bundle/signature.h:106:50: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive] 
Status BindGenericInputs(const GenericSignature& signature, 
               ^
./tensorflow_serving/session_bundle/signature.h:117:31: error: 'GenericSignature' does not name a type 
Status BindGenericNames(const GenericSignature& signature, 
          ^
./tensorflow_serving/session_bundle/signature.h:117:49: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive] 
Status BindGenericNames(const GenericSignature& signature, 
               ^
tensorflow_serving/session_bundle/session_bundle.cc:68:49: error: 'AssetFile' was not declared in this scope 
           const std::vector<AssetFile>& asset_files, 
               ^
tensorflow_serving/session_bundle/session_bundle.cc:68:49: note: suggested alternative: 
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:29, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile' 
class AssetFile : public ::google::protobuf::Message { 
    ^
tensorflow_serving/session_bundle/session_bundle.cc:68:58: error: template argument 1 is invalid 
           const std::vector<AssetFile>& asset_files, 
                 ^
tensorflow_serving/session_bundle/session_bundle.cc:68:58: error: template argument 2 is invalid 
tensorflow_serving/session_bundle/session_bundle.cc: In function 'void tensorflow::serving::{anonymous}::AddAssetsTensorsToInputs(tensorflow::StringPiece, const int&, std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> >*)': 
tensorflow_serving/session_bundle/session_bundle.cc:70:20: error: request for member 'empty' in 'asset_files', which is of non-class type 'const int' 
    if (!asset_files.empty()) { 
        ^
tensorflow_serving/session_bundle/session_bundle.cc:71:24: error: no matching function for call to 'begin(const int&)' 
    for (auto& asset : asset_files) { 
         ^
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: candidates are: 
In file included from /usr/include/c++/4.8/string:51:0, 
       from /usr/include/c++/4.8/stdexcept:39, 
       from /usr/include/c++/4.8/array:38, 
       from /usr/include/c++/4.8/tuple:39, 
       from /usr/include/c++/4.8/functional:55, 
       from /usr/include/c++/4.8/memory:79, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:21, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
/usr/include/c++/4.8/bits/range_access.h:87:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm]) 
    begin(_Tp (&__arr)[_Nm]) 
    ^
/usr/include/c++/4.8/bits/range_access.h:87:5: note: template argument deduction/substitution failed: 
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types '_Tp [_Nm]' and 'const int' 
    for (auto& asset : asset_files) { 
         ^
In file included from /usr/include/c++/4.8/string:51:0, 
       from /usr/include/c++/4.8/stdexcept:39, 
       from /usr/include/c++/4.8/array:38, 
       from /usr/include/c++/4.8/tuple:39, 
       from /usr/include/c++/4.8/functional:55, 
       from /usr/include/c++/4.8/memory:79, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:21, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
/usr/include/c++/4.8/bits/range_access.h:58:5: note: template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) 
    begin(const _Container& __cont) -> decltype(__cont.begin()) 
    ^
/usr/include/c++/4.8/bits/range_access.h:58:5: note: template argument deduction/substitution failed: 
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = int]': 
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here 
/usr/include/c++/4.8/bits/range_access.h:58:5: error: request for member 'begin' in '__cont', which is of non-class type 'const int' 
/usr/include/c++/4.8/bits/range_access.h:48:5: note: template<class _Container> decltype (__cont.begin()) std::begin(_Container&) 
    begin(_Container& __cont) -> decltype(__cont.begin()) 
    ^
/usr/include/c++/4.8/bits/range_access.h:48:5: note: template argument deduction/substitution failed: 
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = const int]': 
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here 
/usr/include/c++/4.8/bits/range_access.h:48:5: error: request for member 'begin' in '__cont', which is of non-class type 'const int' 
In file included from /usr/include/c++/4.8/utility:74:0, 
       from /usr/include/c++/4.8/tuple:38, 
       from /usr/include/c++/4.8/functional:55, 
       from /usr/include/c++/4.8/memory:79, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:21, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
/usr/include/c++/4.8/initializer_list:89:5: note: template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>) 
    begin(initializer_list<_Tp> __ils) noexcept 
    ^
/usr/include/c++/4.8/initializer_list:89:5: note: template argument deduction/substitution failed: 
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 
    for (auto& asset : asset_files) { 
         ^
tensorflow_serving/session_bundle/session_bundle.cc:71:24: error: no matching function for call to 'end(const int&)' 
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: candidates are: 
In file included from /usr/include/c++/4.8/string:51:0, 
       from /usr/include/c++/4.8/stdexcept:39, 
       from /usr/include/c++/4.8/array:38, 
       from /usr/include/c++/4.8/tuple:39, 
       from /usr/include/c++/4.8/functional:55, 
       from /usr/include/c++/4.8/memory:79, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:21, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
/usr/include/c++/4.8/bits/range_access.h:97:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm]) 
    end(_Tp (&__arr)[_Nm]) 
    ^
/usr/include/c++/4.8/bits/range_access.h:97:5: note: template argument deduction/substitution failed: 
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types '_Tp [_Nm]' and 'const int' 
    for (auto& asset : asset_files) { 
         ^
In file included from /usr/include/c++/4.8/string:51:0, 
       from /usr/include/c++/4.8/stdexcept:39, 
       from /usr/include/c++/4.8/array:38, 
       from /usr/include/c++/4.8/tuple:39, 
       from /usr/include/c++/4.8/functional:55, 
       from /usr/include/c++/4.8/memory:79, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:21, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&) 
    end(const _Container& __cont) -> decltype(__cont.end()) 
    ^
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template argument deduction/substitution failed: 
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(const _Container&) [with _Container = int]': 
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here 
/usr/include/c++/4.8/bits/range_access.h:78:5: error: request for member 'end' in '__cont', which is of non-class type 'const int' 
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&) 
    end(_Container& __cont) -> decltype(__cont.end()) 
    ^
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template argument deduction/substitution failed: 
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(_Container&) [with _Container = const int]': 
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here 
/usr/include/c++/4.8/bits/range_access.h:68:5: error: request for member 'end' in '__cont', which is of non-class type 'const int' 
In file included from /usr/include/c++/4.8/utility:74:0, 
       from /usr/include/c++/4.8/tuple:38, 
       from /usr/include/c++/4.8/functional:55, 
       from /usr/include/c++/4.8/memory:79, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:21, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
/usr/include/c++/4.8/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>) 
    end(initializer_list<_Tp> __ils) noexcept 
    ^
/usr/include/c++/4.8/initializer_list:99:5: note: template argument deduction/substitution failed: 
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 
    for (auto& asset : asset_files) { 
         ^
tensorflow_serving/session_bundle/session_bundle.cc:76:69: error: no matching function for call to 'std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> >::push_back(<brace-enclosed initializer list>)' 
      {asset.tensor_binding().tensor_name(), assets_file_tensor}); 
                    ^
tensorflow_serving/session_bundle/session_bundle.cc:76:69: note: candidates are: 
In file included from /usr/include/c++/4.8/vector:64:0, 
       from external/protobuf/src/google/protobuf/unknown_field_set.h:43, 
       from external/protobuf/src/google/protobuf/metadata.h:43, 
       from bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/core/lib/core/error_codes.pb.h:25, 
       from external/org_tensorflow/tensorflow/core/lib/core/status.h:22, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:23, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::basic_string<char>, tensorflow::Tensor>; _Alloc = std::allocator<std::pair<std::basic_string<char>, tensorflow::Tensor> >; std::vector<_Tp, _Alloc>::value_type = std::pair<std::basic_string<char>, tensorflow::Tensor>] 
     push_back(const value_type& __x) 
    ^
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<std::basic_string<char>, tensorflow::Tensor>&}' 
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<std::basic_string<char>, tensorflow::Tensor>; _Alloc = std::allocator<std::pair<std::basic_string<char>, tensorflow::Tensor> >; std::vector<_Tp, _Alloc>::value_type = std::pair<std::basic_string<char>, tensorflow::Tensor>] 
     push_back(value_type&& __x) 
    ^
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> >::value_type&& {aka std::pair<std::basic_string<char>, tensorflow::Tensor>&&}' 
tensorflow_serving/session_bundle/session_bundle.cc: At global scope: 
tensorflow_serving/session_bundle/session_bundle.cc:103:39: error: 'AssetFile' was not declared in this scope 
        const std::vector<AssetFile>& asset_files, 
            ^
tensorflow_serving/session_bundle/session_bundle.cc:103:39: note: suggested alternative: 
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:29, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile' 
class AssetFile : public ::google::protobuf::Message { 
    ^
tensorflow_serving/session_bundle/session_bundle.cc:103:48: error: template argument 1 is invalid 
        const std::vector<AssetFile>& asset_files, 
               ^
tensorflow_serving/session_bundle/session_bundle.cc:103:48: error: template argument 2 is invalid 
tensorflow_serving/session_bundle/session_bundle.cc:117:36: error: 'AssetFile' was not declared in this scope 
        const std::vector<AssetFile>& asset_files, 
            ^
tensorflow_serving/session_bundle/session_bundle.cc:117:36: note: suggested alternative: 
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:29, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile' 
class AssetFile : public ::google::protobuf::Message { 
    ^
tensorflow_serving/session_bundle/session_bundle.cc:117:45: error: template argument 1 is invalid 
        const std::vector<AssetFile>& asset_files, 
              ^
tensorflow_serving/session_bundle/session_bundle.cc:117:45: error: template argument 2 is invalid 
tensorflow_serving/session_bundle/session_bundle.cc: In function 'tensorflow::Status tensorflow::serving::LoadSessionBundleFromPath(const tensorflow::SessionOptions&, tensorflow::StringPiece, tensorflow::serving::SessionBundle*)': 
tensorflow_serving/session_bundle/session_bundle.cc:165:15: error: 'AssetFile' was not declared in this scope 
    std::vector<AssetFile> asset_files; 
      ^
tensorflow_serving/session_bundle/session_bundle.cc:165:15: note: suggested alternative: 
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:29, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile' 
class AssetFile : public ::google::protobuf::Message { 
    ^
tensorflow_serving/session_bundle/session_bundle.cc:165:24: error: template argument 1 is invalid 
    std::vector<AssetFile> asset_files; 
         ^
tensorflow_serving/session_bundle/session_bundle.cc:165:24: error: template argument 2 is invalid 
tensorflow_serving/session_bundle/session_bundle.cc:165:37: error: invalid type in declaration before ';' token 
    std::vector<AssetFile> asset_files; 
            ^
tensorflow_serving/session_bundle/session_bundle.cc:170:17: error: expected ';' before 'asset_file' 
     AssetFile asset_file; 
       ^
tensorflow_serving/session_bundle/session_bundle.cc:171:25: error: the value of 'AssetFile' is not usable in a constant expression 
     if (!any_asset.Is<AssetFile>()) { 
         ^
tensorflow_serving/session_bundle/session_bundle.cc:165:15: note: 'AssetFile' was not declared 'constexpr' 
    std::vector<AssetFile> asset_files; 
      ^
tensorflow_serving/session_bundle/session_bundle.cc:171:36: error: no matching function for call to 'google::protobuf::Any::Is() const' 
     if (!any_asset.Is<AssetFile>()) { 
            ^
tensorflow_serving/session_bundle/session_bundle.cc:171:36: note: candidate is: 
In file included from bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/core/protobuf/meta_graph.pb.h:32:0, 
       from ./tensorflow_serving/session_bundle/session_bundle.h:25, 
       from tensorflow_serving/session_bundle/session_bundle.cc:16: 
external/protobuf/src/google/protobuf/any.pb.h:66:29: note: template<class T> bool google::protobuf::Any::Is() const 
    template<typename T> bool Is() const { 
          ^
external/protobuf/src/google/protobuf/any.pb.h:66:29: note: template argument deduction/substitution failed: 
tensorflow_serving/session_bundle/session_bundle.cc:174:13: error: 'asset_file' was not declared in this scope 
      asset_file.descriptor()->full_name(), ". Got: ", 
      ^
tensorflow_serving/session_bundle/session_bundle.cc:178:32: error: 'asset_file' was not declared in this scope 
     if (!any_asset.UnpackTo(&asset_file)) { 
           ^
tensorflow_serving/session_bundle/session_bundle.cc:182:19: error: request for member 'push_back' in 'asset_files', which is of non-class type 'int' 
     asset_files.push_back(asset_file); 
       ^
tensorflow_serving/session_bundle/session_bundle.cc:182:29: error: 'asset_file' was not declared in this scope 
     asset_files.push_back(asset_file); 
          ^
Target //tensorflow_serving/example:mnist_inference_2 failed to build 
Use --verbose_failures to see the command lines of failed build steps. 
INFO: Elapsed time: 4.822s, Critical Path: 4.54s 
+0

Warum fragst du nicht auf der Mailingliste des Projekts? Wir sind nicht ihr Support-Service. –

+0

ufff ... In der Mailingliste sagen sie auch dasselbe. Nun, ich behandle niemanden von Ihnen als Support-Service, sondern ein offenes Forum zum Lernen und Teilen. – jolly

+0

Mit "say the same" meinte ich in der Mailingliste, dass sie im Stackoverflow posten sollen. Ist das der gleiche Kerl, der uns quält? – jolly

Antwort

1

Von der Seite, die Sie verknüpft: „Bevor Sie beginnen, füllen Sie bitte die prerequisites.“

Der Typ Signatures in einem Header, dem nach dem genannten prereqs Prozess erzeugt definiert ist, so dass Sie entweder haben nicht diese Schritte befolgt oder nicht richtig befolgt - es gibt keine Möglichkeit zu sagen, nur aus dem Compiler Fehler.

+0

Ich werde alle Schritte sicher folgen. Übrigens fehlen die folgenden 2 Header in git Repo des Beispielordners in tensorflow_serving. #include "tensorflow_serving/example/mnist_inference.grpc.pb.h" #include "tensorflow_serving/Beispiel/mnist_inferenz.pb.h" – jolly