question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

import keras_cv fails

See original GitHub issue

First, thank you so much to all the contributors for their tremendous effort in building keras-cv.

Obviously, I would like to try it out, but in colab I could not load keras-cv:

https://colab.research.google.com/drive/1k-IrSJF-DlP_o27ohr7GvYsXliGRifTF?usp=sharing

---------------------------------------------------------------------------

ModuleNotFoundError                       Traceback (most recent call last)

[<ipython-input-6-1d020d0fde65>](https://localhost:8080/#) in <module>()
      1 import tensorflow as tf
----> 2 import keras_cv

1 frames

[/usr/local/lib/python3.7/dist-packages/keras_cv/layers/__init__.py](https://localhost:8080/#) in <module>()
     13 # limitations under the License.
     14 
---> 15 from tensorflow.keras.__internal__.layers import BaseImageAugmentationLayer
     16 from tensorflow.keras.layers import CenterCrop
     17 from tensorflow.keras.layers import RandomBrightness

ModuleNotFoundError: No module named 'tensorflow.keras.__internal__.layers'


---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Above is the error message I am getting. What am I missing? Any suggestions would be appreciated.

Thank you, John

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:18 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
adhadsecommented, May 19, 2022

Run this cell:

%%bash
git clone https://github.com/keras-team/keras-cv.git
mv keras-cv/keras_cv /content/keras_cv

pip uninstall tensorflow -y
pip install tf-nightly==2.10.0.dev20220427

pip uninstall keras -y
pip install keras-nightly==2.10.0.dev2022042807

import keras_cv

The library is currently using a nightly version of TensorFlow and Keras for development. This is what we are using, give it a shot.

0reactions
qlzh727commented, May 23, 2022

Ack. Will comment on #440.

Read more comments on GitHub >

github_iconTop Results From Across the Web

keras-cv - PyPI
KerasCV is a repository of modular building blocks (layers, metrics, losses, data-augmentation) that applied computer vision engineers can leverage to ...
Read more >
how to fix "import keras not working" error - Stack Overflow
Try installing tensorflow first: pip install tensorflow. Then access keras via tensorflow from tensorflow.keras.models import Sequential ...
Read more >
Losses - Keras
The purpose of loss functions is to compute the quantity that a model should seek to minimize during training. Available losses. Note that...
Read more >
Importing a TensorFlow GraphDef based Models into ...
Importing a TensorFlow model into TensorFlow.js is a two-step process. ... the tensorflowjs_converter script will fail and print out a list ...
Read more >
Testing tensorflow 2.9 and KerasCV on Kaggle TPU
Click here to see the current version with an error. ... import tensorflow_datasets as tfds import tensorflow as tf import keras_cv N_batch ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found