Skip to content

Commit

Permalink
fix: support TF 2.13 for conv_utils module
Browse files Browse the repository at this point in the history
conv_utils module has been moved again in TF 2.13, and can be imported as in
TF <= 2.5. The error raised is ImportError, which was added to the try/except
clause.
  • Loading branch information
danibene authored and cofri committed Jul 26, 2023
1 parent b01dfd0 commit 04b03f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions deel/lip/layers/convolutional.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@

try:
from keras.utils import conv_utils # in Keras for TF >= 2.6
except ModuleNotFoundError:
from tensorflow.python.keras.utils import conv_utils # in TF.python for TF <= 2.5
except ImportError or ModuleNotFoundError:
# conv_utils in tf.python for TF <= 2.5 and TF >= 2.13
from tensorflow.python.keras.utils import conv_utils


def _compute_conv_lip_factor(kernel_size, strides, input_shape, data_format):
Expand Down

0 comments on commit 04b03f8

Please sign in to comment.