tensorflow / model-optimization

A toolkit to optimize ML models for deployment for Keras and TensorFlow, including quantization and pruning.
https://www.tensorflow.org/model_optimization
Apache License 2.0
1.49k stars 319 forks source link

Pruning error of transfer learning model MobilenetV3 Large ! #864

Open somum opened 2 years ago

somum commented 2 years ago

Trying to prune MobilenetV3 Large model after training but showing an error of -

ValueError: Please initialize Prune with a supported layer. Layers should either be supported by the PruneRegistry (built-in keras layers) or should be a PrunableLayer instance, or should has a customer defined get_prunable_weights method. You passed: <class 'tensorflow.python.keras.layers.preprocessing.image_preprocessing.Rescaling'>

I was following the guide of Tensorflow here.

rino20 commented 2 years ago

Hi @somum

This has been resolved in https://github.com/tensorflow/model-optimization/pull/754 Could you sync your tfmot with HEAD or nightly and re-test the code?