cyrusbehr / tensorrt-cpp-api

TensorRT C++ API Tutorial
MIT License
577 stars 72 forks source link

no member named `buildSerializedNetwork` #10

Closed impaktor closed 1 year ago

impaktor commented 1 year ago

Following the build instructions (except I'm on Ubuntu 18.04), I keep getting the following compile error:

tensorrt-cpp-api/src/engine.cpp:127:48: error: ‘class nvinfer1::IBuilder’ has no member named ‘buildSerializedNetwork’
     std::unique_ptr<IHostMemory> plan{builder->buildSerializedNetwork(*network, *config)};

buildSerializedNetwork() is indeed is part of IBuilder, so question is what the builder object is.

It is constructed from:

auto builder = std::unique_ptr<nvinfer1::IBuilder>(nvinfer1::createInferBuilder(m_logger));

And interestingly, I can not find nvinfer1::createInferBuilder when searching the doxygen documentation.

However, after much digging, I managed to get to this page (not indexed by the search function?), that describes it as "anonymous_namespace", and I'm not sure if that is related to the compiler not finding it:

nvinfer1::anonymous_namespace{NvInfer.h} Namespace Reference

Constraint: I'm on Ubuntu 18.04, and Jetson sdk 4.3. If this is a version issue, / code deprecation, I would have expected others to hit the same issue? I can not upgrade, since 4.3 is a requirement set for the project I'm on (all drones that will run the model are on 4.3).

Any clue on how to resolve this would be greatly appreciated

impaktor commented 1 year ago

Upon further digging, my TensorRT version is 7.1.3, while I think this repo is for v.8, thus this issue is obsolete, so I'm closing this.

For any future person bashing their head against this problem, consider:

cyrusbehr commented 1 year ago

Yes you are correct, this repo works with TensorRT 8.x. I will update the readme to make this more clear.