We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 417e5b5 commit 8b460beCopy full SHA for 8b460be
keras_tuner/backend/config.py
@@ -12,15 +12,16 @@
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
15
-import keras
+import os
16
17
18
-def _multi_backend():
+if os.environ.get("TF_USE_LEGACY_KERAS", None) in ("true", "True", "1"):
19
+ from tensorflow as keras
20
+ _MULTI_BACKEND = False
21
+else:
22
+ import keras
23
version_fn = getattr(keras, "version", None)
- return version_fn and version_fn().startswith("3.")
-
-_MULTI_BACKEND = _multi_backend()
24
+ _MULTI_BACKEND = version_fn and version_fn().startswith("3.")
25
26
27
def multi_backend():
0 commit comments