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

A error about quantization aware training #1105

Closed panhu closed 9 months ago

panhu commented 9 months ago

Prior to filing: check that this should be a bug instead of a feature request. Everything supported, including the compatible versions of TensorFlow, is listed in the overview page of each technique. For example, the overview page of quantization-aware training is here. An issue for anything not supported should be a feature request.

Describe the bug When i want to use quantization aware training,the code is:

quan_aware_model = tfmot.quantization.keras.quantize_apply(annotated_model),

and the error is:

File "../../../keras/src/saving/legacy/serialization.py",line 536,in deserialize_keras_object obj = module_objects.get(object_name) AttibuteError:"NoneType" object has no attribute 'get' System information

TensorFlow version 2.13.1:

TensorFlow Model Optimization version 0.7.5(installed from source):

Python version: 3.8

lenscloth commented 9 months ago

Hello @panhu,

Would you mind providing us with reproducible code such that we can identify the problem?

panhu commented 9 months ago

Thanks,Due to tf version issues and solutions