【发布时间】:2021-01-08 10:03:07
【问题描述】:
我想量化一个 DenseNet 模型。我正在使用 TensorFlow 2.4。
import tensorflow_model_optimization as tfmot
model = tf.keras.applications.DenseNet121(include_top=True,weights=None,input_tensor=None,input_shape=None,pooling=None,classes=1000)
quantize_model = tfmot.quantization.keras.quantize_model
model = quantize_model(model)
但我收到以下消息:
RuntimeError: Layer conv2_block1_0_bn:tfmot.quantization.keras.QuantizeConfig 实例传递给quantize_annotate_layer API 来量化这一层。
有什么办法可以做到这一点。 我无法更改 keras 代码。
【问题讨论】:
标签: python tensorflow keras quantization densenet