tensorflow: Tensorflow-2.3.0 build failed
System information
- OS Platform and Distribution :Linux Ubuntu 16.04
- TensorFlow installed from (source or binary): Source
- TensorFlow version: 2.3.0
- Python version: 3.8.5
- Bazel version (if compiling from source): 3.1.0
- GCC/Compiler version (if compiling from source): 5.4.0
- CUDA/cuDNN version: Cuda10.0, cudnn 7.6.5.32
- GPU model and memory: GTX1070 , 8G
Describe the problem Cannot build tensorflow
Tensorflow configured with cuda and tensorrt enabled
build with
bazel build --config=opt --config=cuda --copt=-mavx --copt=-mavx2 --copt=-msse4.1 --copt=-msse4.2 --copt=-mfma --copt=-mfpmath=both //tensorflow/tools/pip_package:build_pip_package
build failed with these output
INFO: From ProtoCompile tensorflow/lite/toco/toco_flags.pb.h:
bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist.
ERROR: /home/bernard/opt/python38/tensorflow-2.3.0/tensorflow/core/kernels/BUILD:5123:1: C++ compilation of rule '//tensorflow/core/kernels:dilation_ops_gpu' failed (Exit 1)
external/com_google_absl/absl/time/internal/cctz/include/cctz/civil_time_detail.h: In function ‘constexpr absl::lts_2020_02_25::time_internal::cctz::detail::civil_day absl::lts_2020_02_25::time_internal::cctz::detail::next_weekday(absl::lts_2020_02_25::time_internal::cctz::detail::civil_day, absl::lts_2020_02_25::time_internal::cctz::detail::weekday)’:
external/com_google_absl/absl/time/internal/cctz/include/cctz/civil_time_detail.h:567:20: error: call to non-constexpr function ‘absl::lts_2020_02_25::time_internal::cctz::detail::civil_time<absl::lts_2020_02_25::time_internal::cctz::detail::day_tag> absl::lts_2020_02_25::time_internal::cctz::detail::operator+(absl::lts_2020_02_25::time_internal::cctz::detail::civil_time<absl::lts_2020_02_25::time_internal::cctz::detail::day_tag>, absl::lts_2020_02_25::time_internal::cctz::diff_t)’
return cd + (j - i);
^
external/com_google_absl/absl/time/internal/cctz/include/cctz/civil_time_detail.h: In function ‘constexpr absl::lts_2020_02_25::time_internal::cctz::detail::civil_day absl::lts_2020_02_25::time_internal::cctz::detail::prev_weekday(absl::lts_2020_02_25::time_internal::cctz::detail::civil_day, absl::lts_2020_02_25::time_internal::cctz::detail::weekday)’:
external/com_google_absl/absl/time/internal/cctz/include/cctz/civil_time_detail.h:587:20: error: call to non-constexpr function ‘absl::lts_2020_02_25::time_internal::cctz::detail::civil_time<absl::lts_2020_02_25::time_internal::cctz::detail::day_tag> absl::lts_2020_02_25::time_internal::cctz::detail::operator-(absl::lts_2020_02_25::time_internal::cctz::detail::civil_time<absl::lts_2020_02_25::time_internal::cctz::detail::day_tag>, absl::lts_2020_02_25::time_internal::cctz::diff_t)’
return cd - (j - i);
^
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: 1001.142s, Critical Path: 93.36s
INFO: 4993 processes: 4993 local.
FAILED: Build did NOT complete successfully
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 46 (25 by maintainers)
I ended up adding
at the beginning of <path_to_tensorflow>/third_party/com_google_absl_fix_mac_and_nvcc_build.patch
adding
in .bazelrc
Build completed successfully with bazel build --config=cuda --config=opt --config=v2 //tensorflow/tools/pip_package:build_pip_package
The patch being talked here is
third_party/com_google_absl_fix_mac_and_nvcc_build.patch. This patch is already being used by TF here https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/workspace.bzl#L227. But we need to update it by adding the additional stuff mentioned https://github.com/mozilla/tensorflow/commit/6fad14b203093e7a19301c4ef51a87fce71e38cb#diff-18a66e25fbcbd72730332a799ddee2ec. And then add following two lines in .bazelrc file which is in tensorflow source code.@Saduf2019 Your two links are completely different issues.