keras-team/keras-io

The version of Keras in Fine-tuning Stable Diffusion example

Mingbo-Lee opened this issue · 2 comments

If I run the Fine-tuning Stable Diffusion example, I got error even run it in Colab

/usr/local/lib/python3.10/dist-packages/keras_cv/models/weights.py in <module>
     12 # See the License for the specific language governing permissions and
     13 import tensorflow as tf
---> 14 from keras.utils import data_utils
     15 
     16 

ImportError: cannot import name 'data_utils' from 'keras.utils' (/usr/local/lib/python3.10/dist-packages/keras/utils/__init__.py)

image

However, if change the version of the keras

pip install keras==2.12.0

The example can run without error.

I think it is necessary to add the requirement of the version of the keras in the example, which is more user-friendly. Could I open a pull request to close this issue?

Hi,
Thanks for reporting the issue.
It is not suggested to downgrade the Keras version when newer version is available.
I was able to identify the root cause, I will go ahead and create a PR.

Thank you for your reply!