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

remove early out in xnnpack pruning policy model traversal #1088

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

christian-steinmeyer
Copy link

If there are multiple input layers (and therefore paths), this early out might return an empty set before all paths are checked. By simply removing it, the path that doesn't have a next layer ends, nothing is added to the found_layers and the other paths continue to be checked.

I stumbled upon this with a model that had multiple inputs, one of which was feeding directly into the last (custom) layer. As soon as the traversal found no next layer after it, I got the error message of no valid input branch:

'Could not find Conv2D 3x3 layer with stride 2x2, input filters == 3 and VALID padding and preceding ZeroPadding2D with padding == 1 in all input branches of the model'

If there are multiple input layers (and therefore paths),
this early out might return an empty set before all paths are checked.
By simply removing it, the path that doesn't have a next layer ends, nothing is added to the `found_layers` and the other paths continue to be checked.
@github-actions github-actions bot added the technique:pruning Regarding tfmot.sparsity.keras APIs and docs label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technique:pruning Regarding tfmot.sparsity.keras APIs and docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant