Open jhelsas opened 3 years ago
Hi @jhelsas, Thanks for reporting this.
The Pruning policy you are using (PruneForLatencyOnXNNPack) is customized for a specific subgraph structure as shown in the guide's example. It searches for a specific conv2d 3x3 layer after Zeropadding2D, so the error message was generated regardless of your model.
Just remove the pruning policy, and follow the further steps in the guide document. I think you can still get a decent performance for the efficient net without the policy.
Please let me know if you need any assistance.
I am having the following error trying to prune an Efficientnet B1 network, but I am unable to understand even what it is referring to:
I am calling tfmot.sparsity.keras.prune_low_magnitude with the following args:
As described here: https://www.tensorflow.org/model_optimization/guide/pruning/pruning_for_on_device_inference
My efficientnet doesn't have any ZeroPadding2D layer, so I don't get why tfmot.sparsity.keras.prune_low_magnitude is throwing that error.
I do have some conv2d with 2x2 strides:
But there is no related ZeroPadding2D layer anywhere, much less before any of those. Changing the padding type to "valid" don't solve the issue.
I am really lost on how to solve this, and any help is welcome. Thanks in advance.