From 322b44d7619bf2664f89ce7a48f6a9e91507e6d0 Mon Sep 17 00:00:00 2001 From: Francois Chollet Date: Sun, 16 Jul 2023 14:28:49 -0700 Subject: [PATCH] Fix build --- keras_core/backend/config.py | 7 ------- requirements-common.txt | 15 --------------- requirements-cuda.txt | 18 ------------------ requirements.txt | 26 +++++++++++++++++--------- setup.py | 5 ++++- 5 files changed, 21 insertions(+), 50 deletions(-) delete mode 100644 requirements-common.txt delete mode 100644 requirements-cuda.txt diff --git a/keras_core/backend/config.py b/keras_core/backend/config.py index df6c8f2a5..5389a9638 100644 --- a/keras_core/backend/config.py +++ b/keras_core/backend/config.py @@ -228,13 +228,6 @@ if "KERAS_BACKEND" in os.environ: _BACKEND = _backend -if _BACKEND != "tensorflow": - # If we are not running on the tensorflow backend, we should stop tensorflow - # from using all available GPU memory. See - # https://www.tensorflow.org/guide/gpu#limiting_gpu_memory_growth - os.environ["TF_FORCE_GPU_ALLOW_GROWTH"] = "true" - - @keras_core_export( [ "keras_core.config.backend", diff --git a/requirements-common.txt b/requirements-common.txt deleted file mode 100644 index 80d8ee73a..000000000 --- a/requirements-common.txt +++ /dev/null @@ -1,15 +0,0 @@ -namex -black>=22 -flake8 -isort -pytest -pandas -absl-py -requests -h5py -protobuf -google -tensorboard-plugin-profile -rich -build -dm-tree diff --git a/requirements-cuda.txt b/requirements-cuda.txt deleted file mode 100644 index 00dc1c291..000000000 --- a/requirements-cuda.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Tensorflow. -# Cuda via pip is only on nightly right now. -# We will pin a known working version to avoid breakages (nightly breaks often). -tf-nightly[and-cuda]==2.14.0.dev20230712 - -# Torch. -# Pin the version used in colab currently (works with tf cuda version). ---extra-index-url https://download.pytorch.org/whl/cu118 -torch==2.0.1+cu118 -torchvision==0.15.2+cu118 - -# Jax. -# Pin the version used in colab currently (works with tf cuda version). ---find-links https://storage.googleapis.com/jax-releases/jax_cuda_releases.html -jax[cuda11_pip]==0.4.10 - -# Common deps. --r requirements-common.txt diff --git a/requirements.txt b/requirements.txt index fcfb834f0..51cb48b0e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,21 @@ -# Tensorflow. tensorflow - -# Torch. -# TODO: Use Torch CPU, remove after resolving Cuda version differences with TF +# TODO: Use Torch CPU +# Remove after resolving Cuda version differences with TF torch>=2.0.1+cpu torchvision>=0.15.1 - -# Jax. jax[cpu] - -# Common deps. --r requirements-common.txt +namex +black>=22 +flake8 +isort +pytest +pandas +absl-py +requests +h5py +protobuf +google +tensorboard-plugin-profile +rich +build +dm-tree diff --git a/setup.py b/setup.py index 8a46fe39b..881db4094 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,10 @@ def get_version(rel_path): HERE = pathlib.Path(__file__).parent README = (HERE / "README.md").read_text() -VERSION = get_version("keras_core/__init__.py") +if os.path.exists("keras_core/version.py"): + VERSION = get_version("keras_core/version.py") +else: + VERSION = get_version("keras_core/__init__.py") setup( name="keras-core",