Using NvCaffeParser at the same time as Protobuf causes an incomprehensible error


I try to use NvCaffeParser and Protobuf in a project, but it fails at runtime with a cryptic message:

const string& google::protobuf::internal::GetEmptyStringAlreadyInited():
Assertion `empty_string_ != __null' failed.

I made a minimal reproducible example. The main file is just:

#include <iostream>

#include "NvCaffeParser.h"

// Not even needed to make it bug
// #include "bug.pb.h"

int main() {
    nvcaffeparser1::ICaffeParser* parser = nvcaffeparser1::createCaffeParser();
    std::cout << "OK" << std::endl;
    return 0;

The CMakeLists looks like this:

cmake_minimum_required(VERSION 3.5)

set(CMAKE_CXX_FLAGS "-std=c++11")

find_package(Protobuf REQUIRED)

# Commenting the following line removes the bug


add_executable(protobug ${PROTO_SRCS})
target_link_libraries(protobug ${PROTOBUF_LIBRARIES} nvcaffe_parser)

I shared all the files in a public repository, so testing it is a simple as this:

git clone && \
cd nvcaffeparser-protobuf-bug && \

It is tested on a freshly flashed Jetson TX1 with JetPack 3.0 (bug appears in 2.3 too). Once flashed, I simply built and installed Protobuf from source (see in the repo). I had to use the v3.0.0 otherwise I would get an error stating that aarch64/ compiled version (3.0.0) was incompatible with installed version (3.2.0).

I am stuck on this since several weeks now. Any help would be much appreciated. Do you think it is an inner bug of NvCaffe? I guess it uses Protobuf internally, could this causes conflicts?


Thanks for your problem.

This is a known issue and already been fixed in the tensorRT2.
TensorRT2 is available now via early access:

We are sorry about this issue and please let us know the results.


This is great news, I am glad to hear that this is a known bug. Thank you for your reply, I applied for the early access.

After being accepted for early access, I unfortunately found that TensorRT 2 was only available for x86 platforms, while I was planning to use it on a Jetson TX1.

Would you have any solution or an indication about the availability date of the ARM version, please?


The TensorRT2 for TX1 support is under planning, however there is no firm schedule yet. Once any clear information, I will share with you