Closed jonbesga closed 1 year ago
Thanks @jonbesga!
Has it worked in other versions or you just noticed now? If the former, please let us know which version.
Having the same issue. Was working in v0.6.1
Repro: Working in v0.6.1 - https://colab.research.google.com/drive/1brn2BhoRhr8LJ7_daB-F7Z_4Lq5bLAVi?usp=sharing Not working in v0.6.2 - https://colab.research.google.com/drive/1QgHiHTQ44fNnOzags5dxsN5Q3pG3PtxM?usp=sharing
@aliftadvantage the colabs above aren't quite right because you never import keras_cv
. However, I was able to replicate the bug after the import (colab).
@ianstenbit I don't see this error in my local dev environment. Could it be related to the new namex
export system?
This is caused by the fact that the non-top level components of StableDiffusion don't have @keras_cv_export
tags on them.
They can be imported in the newer versions under keras_cv.src.models.stable_diffusion
, and we can include a @keras_cv_export
tag for them if we'd like to export them directly.
edit: To be clear, yes this is due to the use of Namex, as we're not currently explicitly exporting SD's component models in our API, only the top-level models.
Interesting. I wonder if we should leave a note in our README because namex
is very new and there is no src
folder in our codebase to even hint at this.
Interesting. I wonder if we should leave a note in our README because
namex
is very new and there is nosrc
folder in our codebase to even hint at this.
We can also just export these symbols if we want, as it's clear that people are using them!
We can also just export these symbols if we want, as it's clear that people are using them!
+1! For example, it uses them in the keras fine-tuning stable diffusion guide: https://keras.io/examples/generative/finetune_stable_diffusion/
We can also just export these symbols if we want, as it's clear that people are using them!
+1! For example, it uses them in the keras fine-tuning stable diffusion guide: https://keras.io/examples/generative/finetune_stable_diffusion/
Ahh yes -- let's include these then! If anyone would like to send a PR I will review it ASAP -- otherwise I'll send a fix tomorrow.
Current Behavior:
pip install keras-cv
to install latest version 0.6.4Try to use anything related to stable diffusion like the tokenizer:
tokenizer = keras_cv.models.stable_diffusion.SimpleTokenizer()
It will complain with
AttributeError: module 'keras_cv.models' has no attribute 'stable_diffusion'
Note that it works if I decide to do the following import
keras_cv.src.models.stable_diffusion.SimpleTokenizer()
where I use thesrc
folderExpected Behavior:
Import works correctly
Version: 0.6.4