Skip to content

ioHelper.cpp:66:5: error: ‘onnx’ has not been declared #38

Description

@Tramac

When I complied the example from the posts/TensorRT-introduction, I got the following error:

ioHelper.cpp: In function ‘std::ostream& nvinfer1::operator<<(std::ostream&, nvinfer1::ILogger::Severity)’:
ioHelper.cpp:52:12: warning: enumeration value ‘kVERBOSE’ not handled in switch [-Wswitch]
     switch (severity)
            ^
ioHelper.cpp: In function ‘size_t nvinfer1::readTensorProto(const string&, float*)’:
ioHelper.cpp:66:5: error: ‘onnx’ has not been declared
     onnx::TensorProto tensorProto;
     ^~~~
ioHelper.cpp:67:10: error: ‘tensorProto’ was not declared in this scope
     if (!tensorProto.ParseFromString(data))
          ^~~~~~~~~~~
ioHelper.cpp:67:10: note: suggested alternative: ‘readTensorProto’
     if (!tensorProto.ParseFromString(data))
          ^~~~~~~~~~~
          readTensorProto
In file included from /home/opt/compiler/gcc-8.2/gcc-8.2/include/c++/8.2.0/cassert:44,
                 from /home/work/protobuf/src/google/protobuf/extension_set.h:42,
                 from /home/work/onnx-tensorrt/build/third_party/onnx/onnx/onnx_onnx2trt_onnx-ml.pb.h:33,
                 from /home/work/onnx-tensorrt/build/third_party/onnx/onnx/onnx-ml.pb.h:2,
                 from /home/work/onnx-tensorrt/third_party/onnx/onnx/onnx_pb.h:50,
                 from ioHelper.cpp:32:
ioHelper.cpp:70:12: error: ‘tensorProto’ was not declared in this scope
     assert(tensorProto.has_raw_data());
            ^~~~~~~~~~~
ioHelper.cpp:70:12: note: suggested alternative: ‘readTensorProto’
make: *** [<builtin>: ioHelper.o] Error 1

I have installed onnx-tensorrt and TensorRT successfully, why can't find onnx?

The ioHelper.cpp is same as it.

Many appreciate if got any reply!

@harrism @angererc @nsakharnykh

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions