Open JingsaiLu opened 7 months ago
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!
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,
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?
I checked the keras-nlp doc https://github.com/keras-team/keras-nlp/tree/master it documented that both keras2 and keras3 are supported.
Which version should I install ?
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.
I also faced the same error and I have installed Tensorflow
is this issue still happening? can someone confirm?
@gustheman I'm still having this issue. When installing keras_nlp==0.12.1 it installs keras==2.10.0 and tf 2.10.1. Also when using keras_nlp==0.14.1 it doesn't let to import to jupyter due missing ops module. Somehow it works when installing libaries in the following order:
!pip install -U -q keras-nlp !pip install -q -U keras>=3
KerasNLP no longer supports Keras 2, we are focusing on Keras 3. This means a few things...
!pip install -U -q keras-nlp
!pip install -q -U keras>=3
So TL;DR, make sure you base installation has tensorflow >2.16 and tensorflow-text >2.16 and things should be fine.
In a colab environment, this should be quite simple. Colab now comes with TensorFlow 2.17. So
!pip install keras-nlp
will do the right thing and pull in all necessary dependancies.
With a base environment where Tensorflow is older, you might want to do something like this to make sure your tf is upgraded...
!pip install -U keras-nlp tensorflow tensorflow-text
Hope that helps!
Hi @JingsaiLu,
Could you please confirm if this issue is resolved for you with the above comment ? Please feel free to close the issue if it is resolved ?
Thank you.
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")`
what is the reason for this ? and how to fix that ?