Installing tensorrflow with bazel on jetson nano 4gb

hello
while trying to build tensorflow 2.4.0 on jetson nano I get the following error
ERROR: /home/hm/tensorflow/tensorflow/compiler/tf2tensorrt/BUILD:39:1: C++ compilation of rule ‘//tensorflow/compiler/tf2tensorrt:tensorrt_stub’ failed (Exit 1)
In file included from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:58:0:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc: In function ‘void* createInferBuilder_INTERNAL(void*, int)’:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc:5:7: error: declaration of ‘void* createInferBuilder_INTERNAL(void*, int)’ has a different exception specifier
void* createInferBuilder_INTERNAL(void* logger, int version) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:17:0:
bazel-out/aarch64-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers/third_party/tensorrt/NvInfer.h:8791:30: note: from previous declaration ‘void* createInferBuilder_INTERNAL(void*, int32_t) noexcept’
extern “C” TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:58:0:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc: In function ‘void* createInferRefitter_INTERNAL(void*, void*, int)’:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc:12:7: error: declaration of ‘void* createInferRefitter_INTERNAL(void*, void*, int)’ has a different exception specifier
void* createInferRefitter_INTERNAL(void* engine, void* logger, int version) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from bazel-out/aarch64-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers/third_party/tensorrt/NvInfer.h:54:0,
from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:17:
bazel-out/aarch64-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers/third_party/tensorrt/NvInferRuntime.h:2581:30: note: from previous declaration ‘void* createInferRefitter_INTERNAL(void*, void*, int32_t) noexcept’
extern “C” TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int32_t version) noexcept;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:58:0:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc: In function ‘void* createInferRuntime_INTERNAL(void*, int)’:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc:19:7: error: declaration of ‘void* createInferRuntime_INTERNAL(void*, int)’ has a different exception specifier
void* createInferRuntime_INTERNAL(void* logger, int version) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from bazel-out/aarch64-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers/third_party/tensorrt/NvInfer.h:54:0,
from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:17:
bazel-out/aarch64-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers/third_party/tensorrt/NvInferRuntime.h:2575:30: note: from previous declaration ‘void* createInferRuntime_INTERNAL(void*, int32_t) noexcept’
extern “C” TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int32_t version) noexcept;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:58:0:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc: In function ‘nvinfer1::ILogger* getLogger()’:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc:26:20: error: declaration of ‘nvinfer1::ILogger* getLogger()’ has a different exception specifier
nvinfer1::ILogger* getLogger() {
^~~~~~~~~
In file included from bazel-out/aarch64-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers/third_party/tensorrt/NvInfer.h:54:0,
from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:17:
bazel-out/aarch64-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers/third_party/tensorrt/NvInferRuntime.h:2593:43: note: from previous declaration ‘nvinfer1::ILogger* getLogger() noexcept’
extern “C” TENSORRTAPI nvinfer1::ILogger* getLogger() noexcept;
^~~~~~~~~
In file included from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:58:0:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc: In function ‘nvinfer1::IPluginRegistry* getPluginRegistry()’:
./tensorflow/compiler/tf2tensorrt/stub/NvInfer_5_1.inc:40:28: error: declaration of ‘nvinfer1::IPluginRegistry* getPluginRegistry()’ has a different exception specifier
nvinfer1::IPluginRegistry* getPluginRegistry() {
^~~~~~~~~~~~~~~~~
In file included from bazel-out/aarch64-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers/third_party/tensorrt/NvInfer.h:54:0,
from tensorflow/compiler/tf2tensorrt/stub/nvinfer_stub.cc:17:
bazel-out/aarch64-opt/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers/third_party/tensorrt/NvInferRuntime.h:2586:51: note: from previous declaration ‘nvinfer1::IPluginRegistry* getPluginRegistry() noexcept’
extern “C” TENSORRTAPI nvinfer1::IPluginRegistry* getPluginRegistry() noexcept;
^~~~~~~~~~~~~~~~~
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5777.909s, Critical Path: 571.98s
INFO: 1598 processes: 1598 local.
FAILED: Build did NOT complete successfully

TensorRT Version: 8
GPU Type:
Nvidia Driver Version:
CUDA Version: 10.2
CUDNN Version: 8.7
please what is the solution to this
Regards
Abdullah

Hi,

This looks like a Jetson issue. Please refer to the below samples in case useful.

For any further assistance, we will move this post to to Jetson related forum.

Thanks!

hello Aakanksha
thanks for the response
I would fellow this following again
regards

Abdullah

the reference made was made using pytorch but am using tensrflow tensorrt and also I do not want to run it using a docker but I want to build it on jetson nano because I’m working on a custom project

Hi Abdullah, I have same issue when using bazel to compile tensorflow 2.4.0. Do you solve your problem?
Appreciate for any suggestion. Thank you for your help.

I wasn’t able to compile using bazel, I had to run a tensorflow docker to get the work done