Closed Algue-Rythme closed 1 year ago
Hi @Algue-Rythme,
TensorFlow indeed changed (again) the way conv_utils
is imported... @danibene suggested in a previous PR to fix this issue (https://github.com/deel-ai/deel-lip/pull/76/commits/04b03f871c6c8ff043881d55bb66525a47a25e4d). His commit was integrated in a broader PR #76 with corrections for other failures introduced by TF 2.13.
However, we didn't notice that ModuleNotFoundError
is a subclass of ImportError
. We can simplify the open PR #76 with your proposition.
Closing this issue as the suggested fix has been merged in #76 . Thank for the contribution !
Version
Tensorflow: 2.13 Deel.lip 1.4.0
Issue
In file : https://github.com/deel-ai/deel-lip/blob/master/deel/lip/layers/convolutional.py
There is the code:
In tensorflow>=2.13 the new path for
conv_utils
istensorflow.python.keras.utils
. Unfortunately, attempting to import withfrom keras.utils import conv_utils
does not yield aModuleNotFoundError
becasue the module exists: instead, it simply yield aImportError
.Since
ImportError
is notModuleNotFoundError
theexcept
does not catch anything.Solution
However observe that per this post that
ModuleNotFoundError
is an instance ofImportError
, therefore we should replace the exception with a more general one.