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

Got ValueError: Unknown layer: 'PaddedConv2D' when running the the script. #10

Open
Elvenson opened this issue Apr 22, 2023 · 0 comments

Comments

@Elvenson
Copy link

I got the following error message when running the finetune.py script:

ValueError: Unknown layer: 'PaddedConv2D'. Please ensure you are using a `keras.utils.custom_object_scope` and that this object is included in the scope. See https://www.tensorflow.org/guide/keras/save_and_serialize#registering_the_custom_object for details.

The line that got this issue is this line in the code: link
Based on my understanding, the built-in copy function cannot copy keras-cv PaddedConv2D layer. After I modified that line to this:

self.ema_diffusion_model = keras.models.clone_model(self.diffusion_model)

The script can run now.
Here are my machine specs:

  • macOS
  • Python 3.8.10
  • tensorflow 2.11.0
  • keras-cv 0.4.0
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

1 participant