classification_models_3D icon indicating copy to clipboard operation
classification_models_3D copied to clipboard

Update according to Keras 3

Open muellerdo opened this issue 2 years ago • 2 comments

Hi,

first, thank you for this wonderful package! :)

Since September 2023, Keras has updated to Keras 3 and restructured some of its code base: https://github.com/keras-team/keras/tree/b9be76a13a1edbea5e17a54bf91da386323222bf/keras

Sadly, due to their updates, the classification_models_3D code is not working anymore on the latest tensorflow/keras version, because the keras.engine submodule does not exist anymore but is required in multiple architectures of classification-models-3D.

See attached the error log:

---------------------------------------------------------------------------

ModuleNotFoundError                       Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/classification_models_3D/models_factory.py](https://localhost:8080/#) in <module>
     12 from .models import mobilenet as mb1
     13 from .models import mobilenet_v2 as mb2
---> 14 from .models import efficientnet as eff
     15 from .models import efficientnet_v2 as eff2
     16 from .models import convnext as next

[/usr/local/lib/python3.10/dist-packages/classification_models_3D/models/efficientnet.py](https://localhost:8080/#) in <module>
     32 from keras.applications import imagenet_utils
---> 33 from keras.engine import training
     34 from keras.layers import VersionAwareLayers
     35 from keras.utils import data_utils

ModuleNotFoundError: No module named 'keras.engine'

Thank you for your time!

Cheers, Dominik

muellerdo avatar Nov 02 '23 13:11 muellerdo

change from keras.engine import training to from keras.src.engine import training

krekiehn avatar Nov 20 '23 11:11 krekiehn

Hello, This thread is a bit old now, I am sorry to wake it up. Did you try the recent release 1.1.0? It should be up-to-date with keras 3. Regards, Nicolas

nicolas-combaret avatar May 07 '24 07:05 nicolas-combaret