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

AttributeError: 'types.SimpleNamespace' object has no attribute 'get_registered_object' from return keras.saving.get_registered_object(config["registered_name"]) in keras_nlp\src\utils\preset_utils.py #19456

Open
jsplyy opened this issue Apr 7, 2024 · 4 comments
Assignees
Labels
Gemma Gemma model specific issues type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.

Comments

@jsplyy
Copy link

jsplyy commented Apr 7, 2024

want to run the demo in the local by following the getting started guide
and config the kaggle API credentials with this doc
but get error when run the setup 5:
`import keras
import keras_nlp
import os

os.environ["KERAS_BACKEND"] = "jax"

gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset("gemma_2b_en")`

image

what is the reason for this ? and how to fix that ?

@github-actions github-actions bot added the Gemma Gemma model specific issues label Apr 7, 2024
@SuryanarayanaY SuryanarayanaY added the type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited. label Apr 8, 2024
@SuryanarayanaY
Copy link
Collaborator

Hi @jsplyy ,

It seems to be version issue for me. Could you please confirm the keras_nlp and keras version being used ? Please install latest versions of both and let us know the outcome. Thanks!

@jsplyy
Copy link
Author

jsplyy commented Apr 8, 2024

Hi @SuryanarayanaY
I am using,
Name: keras-nlp
Version: 0.9.1
https://pypi.org/project/keras-nlp/
Name: keras
Version: 2.10.0

try to update keras with command: pip upgrade keras
it will be updated to 3.1.1,
image

but when try to update keras_nlp with command: pip install --upgrade keras_nlp
keras-2.10.0 will be installed again.
keras_nlp seems to depends on and install 2.10.0 keras?
image

I checked the keras-nlp doc https://github.com/keras-team/keras-nlp/tree/master
it documented that both keras2 and keras3 are supported.
image

Which version should I install ?

@SuryanarayanaY
Copy link
Collaborator

keras_nlp seems to depends on and install 2.10.0 keras?

Hi @jsplyy ,

No, it don't have any dependency on Keras 2.10.0 . Please ensure all the dependencies in requirements.txt installed. Keras_nlp needs Tensorflow also. May be you might have TF2.10v which might be reason for this behaviour.

@dongex
Copy link

dongex commented Apr 17, 2024

I also faced the same error and I have installed Tensorflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gemma Gemma model specific issues type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.
Projects
None yet
Development

No branches or pull requests

3 participants