在编译TensorRT6.0的时候,可能会遇到protobuf下载导致的错误,
错误的issue:https://github.com/NVIDIA/TensorRT/issues/78
主要报错内容:
CMakeFiles/third_party.protobuf.dir/build.make:90: recipe for target 'third_party.protobuf/src/third_party.protobuf-stamp/third_party.protobuf-download' failed
make[2]: *** [third_party.protobuf/src/third_party.protobuf-stamp/third_party.protobuf-download] Error 1
CMakeFiles/Makefile2:139: recipe for target 'C
MakeFiles/third_party.protobuf.dir/all' failed
解决方法
issue上有一种解决方法是在编译cmake的时候加curl参数,我试过,没有解决我的问题。
查看报错内容,分析发现是是因为protobuf文件无法下载下来,于是根据报错内容,自己下载cmake的源码包,然后修改cmake文件,进行解决
修改的步骤如下:
1. 编译的时候,指定protobuf版本
在编译语句中,添加如下参数:
-DPROTOBUF_VERSION="3.11.4"
完整一点的
cmake .. -DTRT_LIB_DIR=$TRT_RELEASE/lib -DTRT_BIN_DIR=`pwd`/out -DPROTOBUF_VERSION="3.11.4"

本文详细介绍了在编译TensorRT6.0过程中遇到的protobuf下载错误问题及其解决方案,包括指定protobuf版本、下载并修改cmake源码、解决extract错误等步骤。
最低0.47元/天 解锁文章
4965

被折叠的 条评论
为什么被折叠?



