Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update according to Keras 3 #16

Open
muellerdo opened this issue Nov 2, 2023 · 2 comments
Open

Update according to Keras 3 #16

muellerdo opened this issue Nov 2, 2023 · 2 comments

Comments

@muellerdo
Copy link

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

@krekiehn
Copy link

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

@nicolas-combaret
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants