tensorflow / tensorflow

An Open Source Machine Learning Framework for Everyone
https://tensorflow.org
Apache License 2.0
185.35k stars 74.16k forks source link

Error: 'class tensorflow::tools::proto_splitter::SavedModelSplitter' has no member named 'WriteToCord' #72108

Closed Nayana-ibm closed 2 weeks ago

Nayana-ibm commented 1 month ago

Facing below failure while executing test suite on Tensorflow master. Command used for test execution: bazel build --define --build_tag_filters=-no_oss,-oss_excluded,-oss_serial,-gpu,-tpu,-benchmark-test,-v1only --test_tag_filters=-no_oss,-oss_excluded,-oss_serial,-gpu,-tpu,-benchmark-test,-v1only --test_size_filters=small,medium --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --copt=-Wno-error=unused-but-set-variable --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=dynamic_kernels --experimental_guard_against_concurrent_changes --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS -- //tensorflow/... -//tensorflow/compiler/tf2tensorrt/... -//tensorflow/core/tpu/... -//tensorflow/lite/... -//tensorflow/tools/toolchains/...

gcc --version: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

ERROR: /root/tensorflow/tensorflow/cc/saved_model/image_format/BUILD:21:11: Compiling tensorflow/cc/saved_model/image_format/internal_api.cc failed: (Exit 1): gcc failed: error executing command (from target //tensorflow/cc/saved_model/image_format:internal_api) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 165 arguments skipped)
In file included from ./tensorflow/tools/proto_splitter/cc/composable_splitter.h:20,
                 from ./tensorflow/tools/proto_splitter/cc/saved_model_splitter.h:18,
                 from tensorflow/cc/saved_model/image_format/internal_api.cc:33:
./tensorflow/tools/proto_splitter/cc/composable_splitter_base.h:33: warning: "IS_OSS" redefined
   33 | #define IS_OSS true
      |
In file included from tensorflow/cc/saved_model/image_format/internal_api.cc:16:
./tensorflow/cc/saved_model/image_format/internal_api.h:27: note: this is the location of the previous definition
   27 | #define IS_OSS false
      |
tensorflow/cc/saved_model/image_format/internal_api.cc:36: warning: "IS_OSS" redefined
   36 | #define IS_OSS false
      |
In file included from ./tensorflow/tools/proto_splitter/cc/composable_splitter.h:20,
                 from ./tensorflow/tools/proto_splitter/cc/saved_model_splitter.h:18,
                 from tensorflow/cc/saved_model/image_format/internal_api.cc:33:
./tensorflow/tools/proto_splitter/cc/composable_splitter_base.h:33: note: this is the location of the previous definition
   33 | #define IS_OSS true
      |
tensorflow/cc/saved_model/image_format/internal_api.cc: In function 'absl::lts_20230802::StatusOr<std::tuple<absl::lts_20230802::Cord, bool> > tensorflow::image_format::WriteSavedModelToCord(tensorflow::SavedModel*)':
tensorflow/cc/saved_model/image_format/internal_api.cc:126:19: error: 'class tensorflow::tools::proto_splitter::SavedModelSplitter' has no member named 'WriteToCord'; did you mean 'WriteToString'?
  126 |   return splitter.WriteToCord();
      |                   ^~~~~~~~~~~
      |                   WriteToString
INFO: Elapsed time: 2594.461s, Critical Path: 70.16s
INFO: 14278 processes: 5059 internal, 9219 local.
FAILED: Build did NOT complete successfully
tilakrayal commented 1 month ago

@Nayana-ibm, Could you please provide the tensorflow and compatible version you are trying and the steps followed to install the tensorflow which helps to debug the issue in an effective way. Thank you!

Nayana-ibm commented 1 month ago

@tilakrayal Please see details below:

TensorFlow version : master Bazel v6.5.0 Python version: 3.12.2 gcc --version: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

Steps to build:

git clone https://github.com/tensorflow/tensorflow
cd tensorflow
./configure
You have bazel 6.5.0 installed.
Please specify the location of python. [Default is /usr/local/bin/python3]:

Found possible Python library paths:
  /usr/local/lib/python3.12/site-packages
Please input the desired Python library path to use.  Default is [/usr/local/lib/python3.12/site-packages]

Do you wish to build TensorFlow with ROCm support? [y/N]: N
No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: N
No CUDA support will be enabled for TensorFlow.

Do you want to use Clang to build TensorFlow? [Y/n]: N
GCC will be used to compile TensorFlow.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -Wno-sign-compare]:

Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: N
Not configuring the WORKSPACE for Android builds.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
        --config=mkl            # Build with MKL support.
        --config=mkl_aarch64    # Build with oneDNN and Compute Library for the Arm Architecture (ACL).
        --config=monolithic     # Config for mostly static monolithic build.
        --config=numa           # Build with NUMA support.
        --config=dynamic_kernels        # (Experimental) Build kernels into separate shared objects.
        --config=v1             # Build with TensorFlow 1 API instead of TF 2 API.
Preconfigured Bazel build configs to DISABLE default on features:
        --config=nogcp          # Disable GCP support.
        --config=nonccl         # Disable NVIDIA NCCL support.
Configuration finished

bazel build --define --build_tag_filters=-no_oss,-oss_excluded,-oss_serial,-gpu,-tpu,-benchmark-test,-v1only --test_tag_filters=-no_oss,-oss_excluded,-oss_serial,-gpu,-tpu,-benchmark-test,-v1only  --test_size_filters=small,medium --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --copt=-Wno-error=unused-but-set-variable --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=dynamic_kernels --experimental_guard_against_concurrent_changes --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS -- //tensorflow/... -//tensorflow/compiler/tf2tensorrt/... -//tensorflow/core/tpu/... -//tensorflow/lite/... -//tensorflow/tools/toolchains/...
Nayana-ibm commented 1 month ago

@tilakrayal Any update please

viddya673 commented 1 month ago

I am facing the same issue with TensorFlow version 2.16.1. Here are some additional details:

x86_64 bazel 6.5.0 gcc --version: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

sawantkumar commented 1 month ago

Hi @pkgoogle ,

I tried replicating this issue , with ubuntu 20, bazel 6.5.0 and python 3.9 and i am getting the below error, can you please take a look

root@tflite-issue-replication:/home/sawantkumar/work/tensorflow# bazel build --define --build_tag_filters=-no_oss,-oss_excluded,-oss_serial,-gpu,-tpu,-benchmark-test,-v1only --test_tag_filters=-no_oss,-oss_excluded,-oss_serial,-gpu,-tpu,-benchmark-test,-v1only  --test_size_filters=small,medium --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --copt=-Wno-error=unused-but-set-variable --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=dynamic_kernels --experimental_guard_against_concurrent_changes --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS -- //tensorflow/... -//tensorflow/compiler/tf2tensorrt/... -//tensorflow/core/tpu/... -//tensorflow/lite/... -//tensorflow/tools/toolchains/...
WARNING: The following configs were expanded more than once: [dynamic_kernels]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
INFO: Reading 'startup' options from /home/sawantkumar/work/tensorflow/.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=217
INFO: Reading rc options for 'build' from /home/sawantkumar/work/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /home/sawantkumar/work/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --features=-force_no_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /home/sawantkumar/work/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/usr/bin/python3 --action_env PYTHON_LIB_PATH=/usr/lib/python3/dist-packages --python_path=/usr/bin/python3 --action_env CLANG_COMPILER_PATH=/usr/lib/llvm-10/bin/clang --repo_env=CC=/usr/lib/llvm-10/bin/clang --repo_env=BAZEL_COMPILER=/usr/lib/llvm-10/bin/clang
INFO: Found applicable config definition build:short_logs in file /home/sawantkumar/work/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /home/sawantkumar/work/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:dynamic_kernels in file /home/sawantkumar/work/tensorflow/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
INFO: Found applicable config definition build:linux in file /home/sawantkumar/work/tensorflow/.bazelrc: --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --copt=-Wno-error=unused-but-set-variable --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=dynamic_kernels --experimental_guard_against_concurrent_changes
INFO: Found applicable config definition build:dynamic_kernels in file /home/sawantkumar/work/tensorflow/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
DEBUG: /root/.cache/bazel/_bazel_root/d4b0d2249c66f1993f1bdd593c2da087/external/local_xla/third_party/py/python_repo.bzl:98:14: 
HERMETIC_PYTHON_VERSION variable was not set correctly, using default version.
Python 3.9 will be used.
To select Python version, either set HERMETIC_PYTHON_VERSION env variable in
your shell:
  export HERMETIC_PYTHON_VERSION=3.12
OR pass it as an argument to bazel command directly or inside your .bazelrc
file:
  --repo_env=HERMETIC_PYTHON_VERSION=3.12
DEBUG: /root/.cache/bazel/_bazel_root/d4b0d2249c66f1993f1bdd593c2da087/external/local_xla/third_party/py/python_repo.bzl:109:10: Using hermetic Python 3.9
WARNING: The following configs were expanded more than once: [dynamic_kernels]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
WARNING: /home/sawantkumar/work/tensorflow/tensorflow/compiler/mlir/lite/stablehlo/BUILD:872:13: target '//tensorflow/compiler/mlir/lite/stablehlo:odml_to_stablehlo' is deprecated: odml_to_stablehlo is being deprecated, please use TFlite converter with flag: converter.target_spec.supported_ops =  [tf.lite.OpsSet.EXPERIMENTAL_STABLEHLO_OPS]
WARNING: /home/sawantkumar/work/tensorflow/tensorflow/core/kernels/BUILD:975:18: target '//tensorflow/core/kernels:bitcast_op' is deprecated: use //third_party/tensorflow/c/kernels:bitcast_op instead
WARNING: /home/sawantkumar/work/tensorflow/tensorflow/python/eager/BUILD:714:18: target '//tensorflow/python/eager:framework_for_generated_wrappers' is deprecated: Depending on this target can cause build dependency cycles. Depend on the fine-grained sub-targets instead.
WARNING: /home/sawantkumar/work/tensorflow/tensorflow/python/ops/distributions/BUILD:9:18: target '//tensorflow/python/ops/distributions:distributions' is deprecated: TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.distributions will not receive new features, and will be removed by early 2019. You should update all usage of `tf.distributions` to `tfp.distributions`.
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/zlib.net/fossils/zlib-1.3.1.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Analyzed 12399 targets (1251 packages loaded, 78333 targets configured).
INFO: Found 12399 targets...
ERROR: /root/.cache/bazel/_bazel_root/d4b0d2249c66f1993f1bdd593c2da087/external/boringssl/BUILD:146:11: Compiling src/ssl/d1_both.cc failed: (Exit 1): clang failed: error executing command (from target @boringssl//:ssl) /usr/lib/llvm-10/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 65 arguments skipped)
error: unknown warning option '-Werror=unused-but-set-variable'; did you mean '-Werror=unused-const-variable'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Werror=unused-but-set-variable'; did you mean '-Werror=unused-const-variable'? [-Werror,-Wunknown-warning-option]
INFO: Elapsed time: 189.739s, Critical Path: 112.50s
INFO: 2310 processes: 1345 internal, 965 local.
FAILED: Build did NOT complete successfully
pkgoogle commented 1 month ago

I'm currently failing for different reasons ... I do want to understand better where this command is coming from. Hi @Nayana-ibm, how/where did you get this command? Did you get it from a resource/documentation?

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

github-actions[bot] commented 2 weeks ago

This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 2 weeks ago

Are you satisfied with the resolution of your issue? Yes No

Nayana-ibm commented 6 days ago

I'm currently failing for different reasons ... I do want to understand better where this command is coming from. Hi @Nayana-ibm, how/where did you get this command? Did you get it from a resource/documentation?

Got this command from TensorFlow CI jobs. https://btx.cloud.google.com/invocations/ebf9f385-7d9a-4cac-ba9e-d835e4d43ff0/targets/tensorflow%2Fofficial%2Fcontinuous%2Flinux_x86_cpu_max_python;config=default/log https://github.com/tensorflow/tensorflow/blob/master/.bazelrc