model-optimization icon indicating copy to clipboard operation
model-optimization copied to clipboard

remove early out in xnnpack pruning policy model traversal

Open christian-steinmeyer opened this issue 2 years ago • 0 comments

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'

christian-steinmeyer avatar Aug 18 '23 12:08 christian-steinmeyer