onnx-tensorrt icon indicating copy to clipboard operation
onnx-tensorrt copied to clipboard

[BUG] Protobuf version incompatible issue in release/7.2.1

Open zhaoyiluo opened this issue 4 years ago • 3 comments

Description

In TensorRT 7.2.1 open-source release eb559b6cdd1ec2169d64c0112fab9b564d8d503b, the Protobuf requirement was changed from >= 3.8.x to Protobuf >= 3.0.x. I didn't know why the maintainers did this change, but it definitely let me in an unpleasant mood today. I remembered there was saying that it was a "typo" so you made this change but I was so sorry I could not find the place.

Back to the topic,

In my first building environment Protobuf == 3.6.1, a bunch of undefined references spewed out regarding Google Protobuf functions.

In my second building environment Protobuf == 3.17.3 (upgraded), a bunch of errors spewed out, like ::google::protobuf::io::CodedInputStream::SetTotalBytesLimit does not take 2 arguments. More information refer to here.

In my third building environment Protobuf == 3.8.0 (downgraded), it worked!

Environment

TensorRT Version: 7.2.1.6 ONNX-TensorRT Version / Branch: release/7.2.1 Operating System + Version: 16.04.1-Ubuntu Python Version (if applicable): 3.7.3

Steps To Reproduce

Just try to downgrade Protobuf below 3.8.0 or upgrade to the latest versions, the problem can be reproduced. I didn't test it on other versions, and what I will do is to use a fixed Protobuf version. :(

zhaoyiluo avatar Jul 12 '21 09:07 zhaoyiluo

How are you building the library? I've just tested the 7.2.1 branch with protobuf 3.6.1 and it compiled fine for me.

build$ protoc --version
libprotoc 3.6.1
cmake .. -DTENSORRT_ROOT=$TRT7
make -j

kevinch-nv avatar Jul 13 '21 01:07 kevinch-nv

Hi @kevinch-nv ,

Here is my workflow for building onnx-tensorrt,

git clone --recursive --branch release/7.2.1 https://github.com/onnx/onnx-tensorrt.git
cd onnx-tensorrt
mkdir build
cd build
cmake .. -DTENSORRT_ROOT=TensorRT-7.2.1.6
make -j
export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
source ~/.bashrc
zhaoyiluo@LC1:~$ protoc --version
libprotoc 3.8.0

BTW, I'm also wondering why the maintainers removed the deprecated setup.py as it was used to create the module imported by other python files?

Please let me know if more information is needed.

Thanks.

zhaoyiluo avatar Jul 13 '21 05:07 zhaoyiluo

Yes, it doesn't work with the latest protobuf. I saw the same error.

image

onnx-tensorrt version: e9456d57605c883cdf985e634ab483e2c1500bb1

snnn avatar Feb 23 '22 07:02 snnn