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

Import keras_cv fails on current master #2400

Closed
smitlg opened this issue Mar 21, 2024 · 5 comments
Closed

Import keras_cv fails on current master #2400

smitlg opened this issue Mar 21, 2024 · 5 comments
Assignees
Labels
type:Bug Something isn't working

Comments

@smitlg
Copy link
Contributor

smitlg commented Mar 21, 2024

Some parts of keras_cv depends on keras_nlp and tensorflow_text. The following errors pops up:

[/usr/local/lib/python3.10/dist-packages/keras_cv/models/feature_extractor/clip/clip_tokenizer.py](https://localhost:8080/#) in <module>
     14 import regex as re
     15 import tensorflow as tf
---> 16 import tensorflow_text as tf_text
     17 
     18 try:

ModuleNotFoundError: No module named 'tensorflow_text'

Fixing this error by pip install tensorflow_text, gives a new error:

[/usr/local/lib/python3.10/dist-packages/keras_cv/models/feature_extractor/clip/clip_tokenizer.py](https://localhost:8080/#) in <module>
    105 
    106 
--> 107 class CLIPTokenizer(BytePairTokenizer):
    108     def __init__(self, **kwargs):
    109         super().__init__(**kwargs)

NameError: name 'BytePairTokenizer' is not defined

This will be only fixed by installing keras_nlp or by the approach used in #2394

@sachinprasadhs sachinprasadhs added the type:Bug Something isn't working label Mar 21, 2024
@sachinprasadhs
Copy link
Collaborator

Hi,

Could you please let us know, what is the API which is causing error while importing.

@smitlg
Copy link
Contributor Author

smitlg commented Mar 22, 2024

Steps to reproduce(assuming you are on current master branch):

  1. Uninstall both keras_nlp and tensorflow_text.
  2. pip install .
  3. Now, do import keras_cv.

@sachinprasadhs
Copy link
Collaborator

Thanks for the input, I was able to reproduce the error

@ayaz-markovate
Copy link

Same problem on Colab. Following this example: https://keras.io/examples/vision/yolov8/#creating-model

@VarunS1997
Copy link
Collaborator

Verified fix was successful and issue is no longer present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants