From 7c51d1d052bcd0722ba0ade8506c5870dab7559e Mon Sep 17 00:00:00 2001 From: MichaelBroughton Date: Sat, 15 May 2021 04:10:24 -0700 Subject: [PATCH] Revert "Upgrade to TensorFlow 2.5.0. (#567)" This reverts commit 61822e6d290c85fe8a90f65a5ecfcd35832da536. --- .bazelversion | 2 +- WORKSPACE | 40 ++++++++++++++++++---------------------- docs/install.md | 10 +++++----- release/setup.py | 3 +-- requirements.txt | 9 ++------- 5 files changed, 27 insertions(+), 37 deletions(-) diff --git a/.bazelversion b/.bazelversion index 0b2eb36f5..fd2a01863 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -3.7.2 +3.1.0 diff --git a/WORKSPACE b/WORKSPACE index 6f1088fd8..6ca0f8e0b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,6 +4,16 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "com_google_absl", + sha256 = "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a", + strip_prefix = "abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d", + urls = [ + "https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz", + "https://github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz", + ], +) + http_archive( name = "com_google_googletest", sha256 = "ff7a82736e158c077e76188232eac77913a15dac0b22508c390ab3f88e6d6d86", @@ -43,11 +53,9 @@ protobuf_deps() # com_google_protobuf depends on @bazel_skylib ?? http_archive( name = "bazel_skylib", - sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", - urls = [ - "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", - ], + sha256 = "bbccf674aa441c266df9894182d80de104cabd19be98be002f6d478aaa31574d", + strip_prefix = "bazel-skylib-2169ae1c374aab4a09aa90e65efe1a3aad4e279b", + urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"], ) http_archive( @@ -77,28 +85,16 @@ http_archive( http_archive( name = "org_tensorflow", - sha256 = "e3d0ee227cc19bd0fa34a4539c8a540b40f937e561b4580d4bbb7f0e31c6a713", - strip_prefix = "tensorflow-2.5.0", + sha256 = "b91ec194ddf6c4a5a2f9d1db4af4daab0b187ff691e6f88142413d2c7e77a3bb", + strip_prefix = "tensorflow-2.4.1", urls = [ - "https://github.com/tensorflow/tensorflow/archive/v2.5.0.zip", + "https://github.com/tensorflow/tensorflow/archive/v2.4.1.zip", ], ) -load("@org_tensorflow//tensorflow:workspace3.bzl", "workspace") - -workspace() - -load("@org_tensorflow//tensorflow:workspace2.bzl", "workspace") - -workspace() - -load("@org_tensorflow//tensorflow:workspace1.bzl", "workspace") - -workspace() - -load("@org_tensorflow//tensorflow:workspace0.bzl", "workspace") +load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace") -workspace() +tf_workspace(tf_repo_name = "@org_tensorflow") load("//third_party/tf:tf_configure.bzl", "tf_configure") diff --git a/docs/install.md b/docs/install.md index 4c290e3eb..c40e04960 100644 --- a/docs/install.md +++ b/docs/install.md @@ -84,7 +84,7 @@ As noted in the TensorFlow guide, the Bazel build system will be required. -Our latest source builds use TensorFlow 2.5.0. To ensure compatibility we use `bazel` version 3.7.2. To remove any existing version of Bazel: +Our latest source builds use TensorFlow 2.4.1. To ensure compatibility we use `bazel` version 3.1.0. To remove any existing version of Bazel:
@@ -96,9 +96,9 @@ Download and install `bazel` version 3.1.0:
 
 
 
-  wget https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel_3.7.2-linux-x86_64.deb
+  wget https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel_3.1.0-linux-x86_64.deb
 
-  sudo dpkg -i bazel_3.7.2-linux-x86_64.deb
+  sudo dpkg -i bazel_3.1.0-linux-x86_64.deb
 
@@ -122,7 +122,7 @@ Finally, confirm installation of the correct `bazel` version: ### 4. Build TensorFlow from source Here we adapt instructions from the TensorFlow [build from source](https://www.tensorflow.org/install/source) -guide, see the link for further details. TensorFlow Quantum is compatible with TensorFlow version 2.5. +guide, see the link for further details. TensorFlow Quantum is compatible with TensorFlow version 2.4. Download the TensorFlow source code: @@ -131,7 +131,7 @@ Download the
   git clone https://github.com/tensorflow/tensorflow.git
   cd tensorflow
-  git checkout v2.5.0
+  git checkout v2.4.1
 
Be sure the virtual environment you created in step 2 is activated. Then, install the TensorFlow dependencies: diff --git a/release/setup.py b/release/setup.py index e5615b8a8..51c303497 100644 --- a/release/setup.py +++ b/release/setup.py @@ -58,7 +58,7 @@ def finalize_options(self): # placed as extra to not have required overwrite existing nightly installs if # they exist. -EXTRA_PACKAGES = ['tensorflow == 2.5.0'] +EXTRA_PACKAGES = ['tensorflow == 2.4.1'] CUR_VERSION = '0.5.0' @@ -106,7 +106,6 @@ def has_ext_modules(self): 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Artificial Intelligence', 'Topic :: Scientific/Engineering :: Mathematics', diff --git a/requirements.txt b/requirements.txt index 9faea9208..30bd3af03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,10 @@ cirq==0.11.0 sympy==1.5 -numpy==1.19.5 # TensorFlow can detect if it was built against other versions. nbconvert==5.6.1 nbformat==4.4.0 pylint==2.4.4 yapf==0.28.0 -tensorflow==2.5.0 +tensorflow==2.4.1 +google-api-python-client==1.8.0 # Needed for compatibility with cirq program protos. googleapis-common-protos==1.52.0 -google-api-core==1.21.0 -google-auth==1.18.0 -google-api-python-client==1.8.0 -grpcio==1.34.1 -protobuf==3.13.0