6

I need to compile Tensorflow from source for compute capability 3.0

I was compiling Tensorflow and I got this error after 6 hours of compiling:

cache/bazel/_bazel_maydin/435ff134a8a529ccec16636685173684/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_2_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/keras/preprocessing/__init__.py", line 21, in <module>
   import keras_preprocessing
ModuleNotFoundError: No module named 'keras_preprocessing'
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: 20674.165s, Critical Path: 247.43s
INFO: 12297 processes: 12297 local.
FAILED: Build did NOT complete successfully

In below link, I found this answer and I think it will work. Error Compiling Tensorflow From Source - No module named 'keras_applications'

pip install keras_applications==1.0.4 --no-deps
pip install keras_preprocessing==1.0.2 --no-deps
pip install h5py==2.8.0

I also got similar error before beginning of build where it says numpy is missing, i just installed it via pip and build started without problem.

But I am scared to run build command again. Because I don't want to compile everything 6 hours again.

If I start building again does it start all over from beginning or it continue from where it failed?

Build command I used is this: bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

I cloned tensorflow repository, checkout to branch 2.0 and started build.

Additional info about system:

  • Cuda 10.0.130
  • cuDNN 7.6.2
  • Bazel 0.26.1
  • Ubuntu 18.04
maydin
  • 195
  • 1
  • 3
  • 15
  • 1
    You being scared of running the build again after an attempted fix is not a question. Please edit your question with a the results of your attempt. If the fix does indeed solve your problem, then this is a duplicate, otherwise if you encounter a new error, then it might turn into a legit question. – Mat Oct 31 '19 at 16:13
  • 1
    Question was if I run build again, does it start from beginning or continue from where it failed. I edited question for clarity. – maydin Oct 31 '19 at 16:35
  • Now your question has become very confusing; your title and body is about keras packages and your actual question is about resuming a bazel build. I suggest you identify what exactly you want to ask and keep it short and simple for the community to help you out as best as it can. – Mat Oct 31 '19 at 16:42

1 Answers1

6

It resumes compiling where it left off after fixing errors.

maydin
  • 195
  • 1
  • 3
  • 15
  • Bazel is incremental. It doesn't re-do the work that has been done, unless you ran `bazel clean` or `bazel clean --expunge`, which is rarely needed. – Jin Nov 01 '19 at 15:39
  • It doesn't seem so. bazel is awful – Dmitry Galchinsky Apr 23 '21 at 23:05
  • In my experience, building tensorflow always starts from the beginning again after a build error. Building on Ubuntu 18.4 on Jetson Nano. – Brad Jul 13 '23 at 16:02