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

Cannot import keras-hub after installation of keras-nlp #20446

Open
Mark531 opened this issue Nov 4, 2024 · 1 comment
Open

Cannot import keras-hub after installation of keras-nlp #20446

Mark531 opened this issue Nov 4, 2024 · 1 comment
Assignees

Comments

@Mark531
Copy link

Mark531 commented Nov 4, 2024

I installed keras-nlp:
>pip install --upgrade keras-nlp

Successfully installed google-auth-oauthlib-0.4.6 keras-2.10.0 protobuf-3.19.6 tensorboard-2.10.1 tensorboard-data-server-0.6.1 tensorflow-2.10.1 tensorflow-estimator-2.10.0

(BTW, it downgraded my version of tensorflow which was not expected)

Then, in a python script:
import keras_hub
triggers:

ImportError: cannot import name 'ops' from 'keras' (C:\Users\kevguima\AppData\Local\anaconda3\envs\genai\lib\site-packages\keras_init_.py)

@Mark531
Copy link
Author

Mark531 commented Nov 4, 2024

I reinstalled keras-nlp from a fresh virtual env and this time, I got a different error:

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.3 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

This suggests that a dependency is missing about numpy v1.x because keras-nlp could install properly, and the error popped during the import.

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

2 participants