Skip to content

Commit

Permalink
Add compatibility with Keras export script (#455)
Browse files Browse the repository at this point in the history
* Add compatibility with Keras export script
  • Loading branch information
CNugteren authored Aug 7, 2023
1 parent 5e8b37a commit 321ba2c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion larq_zoo/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
from tensorflow.python.keras.backend import is_keras_tensor

if version.parse(tf.__version__) >= version.parse("2.6"):
from keras.applications.imagenet_utils import obtain_input_shape
try:
from keras.applications.imagenet_utils import obtain_input_shape
except ImportError:
# type: ignore
from keras.src.applications.imagenet_utils import obtain_input_shape
else:
try:
# type: ignore
Expand Down

0 comments on commit 321ba2c

Please sign in to comment.