From a9f8db35a1c1af7627a533fc3dc7f202a88f7b69 Mon Sep 17 00:00:00 2001 From: kangyuzhe666 <1399109998@qq.com> Date: Thu, 10 Dec 2020 15:01:45 +0800 Subject: [PATCH] Update __init__.py Modify the code to fully support tensorflow2.0. There is no need to install any independent keras library when using tensorflow2.0 and above. --- efficientnet/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/efficientnet/__init__.py b/efficientnet/__init__.py index 38cc885..cb9dc72 100644 --- a/efficientnet/__init__.py +++ b/efficientnet/__init__.py @@ -34,7 +34,7 @@ def get_submodules_from_kwargs(kwargs): def inject_keras_modules(func): - import keras + from tensorflow import keras @functools.wraps(func) def wrapper(*args, **kwargs): kwargs['backend'] = keras.backend @@ -60,7 +60,7 @@ def wrapper(*args, **kwargs): def init_keras_custom_objects(): - import keras + from tensorflow import keras from . import model custom_objects = {