Skip to content

Commit 96bdb5b

Browse files
committed
Merge: [Efficientnet/TF2] fix keras imports
2 parents fc9c09b + 820b6dd commit 96bdb5b

File tree

1 file changed

+5
-1
lines changed
  • TensorFlow2/Classification/ConvNets/dataloader

1 file changed

+5
-1
lines changed

TensorFlow2/Classification/ConvNets/dataloader/augment.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
import tensorflow as tf
2727
from typing import Any, Dict, List, Optional, Text, Tuple
2828

29-
from keras.layers.preprocessing import image_preprocessing as image_ops
29+
try:
30+
from keras.layers.preprocessing import image_preprocessing as image_ops
31+
except (ImportError, ModuleNotFoundError):
32+
import keras.src.layers.preprocessing.image_preprocessing as image_ops
33+
3034

3135
# This signifies the max integer that the controller RNN could predict for the
3236
# augmentation scheme.

0 commit comments

Comments
 (0)