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

Convert ddim #743

Merged
merged 2 commits into from
Aug 18, 2023
Merged

Convert ddim #743

merged 2 commits into from
Aug 18, 2023

Conversation

freedomtan
Copy link
Contributor

  1. colab notebook
  2. diff f98790b
  • convert keras/tf.keras to keras_core
  • replace most of tf ops except tf.image, tf.data, and tf.GrapdientTap
  • fix ops.concat out of range issue

1. convert keras/tf.keras to keras_core
2. replace most of tf ops except tf.image, tf.data, and tf.GrapdientTap
3. fix ops.concat out of range issue
Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Looking good!

@@ -69,7 +69,8 @@ def build(self, input_shape):
if axis != concat_axis and axis_value == 1:
del reduced_inputs_shapes[i][axis]

del reduced_inputs_shapes[i][self.axis]
if len(reduced_inputs_shapes[i]) > self.axis:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this come up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the example, in Inception V3, some axes were squeezed out, and thus, there were error messages showing out-of-range while accessing the reduced_inputs_shapes[i][self.axis]. Alternatives I could think of:

  1. Don’t squeeze
  2. When squeezing, also decrement self.axis

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fchollet fchollet merged commit 56652f1 into keras-team:main Aug 18, 2023
6 checks passed
@freedomtan freedomtan deleted the convert_ddim branch August 20, 2023 23:56
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

Successfully merging this pull request may close these issues.

2 participants