[SOLVED] TensorFlow/text build error - "fatal error: tensorflow/core/framework/dataset_stateful_op_allowlist.h: No such file or directory"

Hi everyone,

I am trying to install tensorflow_text on my Jetson Xavier NX building it from source.
Unfortunately, when I run

./oss_scripts/run_build.sh 

The following error occurs

ERROR: /home/nvidia/text/tensorflow_text/core/kernels/BUILD:355:1: C++ compilation of rule '//tensorflow_text/core/kernels:sentencepiece_kernels' failed (Exit 1)
tensorflow_text/core/kernels/sentencepiece_kernels.cc:26:10: fatal error: tensorflow/core/framework/dataset_stateful_op_allowlist.h: No such file or directory
 #include "tensorflow/core/framework/dataset_stateful_op_allowlist.h"

Following the path I found with

pip3 show tensorflow

I verified that the file does not exist.

Tensorflow version: 2.3.1+nv20.12 
Jetpack 4.5
Bazel version: 2.0.0

May someone help me in solving this error?

Hi,

Have you tried the similar on a desktop environment before?
Does this only occur on the Jetson environment?

It seems that tensorflow_text try to link tensorflow header file.
Maybe update some include patch can help.

Thanks.

1 Like

Thank you for your reply!

I have solved the problem by building an older branch of the tensorflow/text library. There is an exact match between the version of this library and the version of TF.