Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Custom_Layer Quantization with custom training (QAT)

未关闭
#1,084 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@Xhark 已经在做这个了。

开始于 2023年8月15日。

评估

这个 Issue 还没有评估数据。

描述

bug

Describe the bug
Unable to quantize the custom layer to Int8 even after quantization.

System information

TensorFlow version (installed from source or binary): 2.15.0-dev20230814

TensorFlow Model Optimization version (installed from source or binary): 0.7.5

Python version: 3.10.12

Describe the expected behavior
Train a model which contains custom layer and export a quantise only the layer to int8 version for later to implement on an FPGA
accelerator.

Describe the current behavior
The custom layer which is supposed to be quantized always exports the un-quantized weights. If I change the tf.lite.OpsSet.TFLITE_BUILTINS to tf.lite.OpsSet.TFLITE_BUILTINS_INT8, the layer is getting quantized but the accuracy of the model is dropping from 99% to 9%. But I followed the QAT guid from as mentioned in the official website and the link to the colab notebook is provided below along with the custom layer code.

Code to reproduce the issue
Code

Additional context
I have used quantize_config while applying the quantization and passed the necessary elements through the scope. I have used tf.lite.OpsSet.SELECT_TF_OPS to enable tf.Extract_images through quantization.
Adder_Layer.txt

主要语言
Python
星标
1.6k
派生
349
平均合并
3 天 2 小时
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tensorflow/model-optimization 的其他 Issue

查看 tensorflow/model-optimization 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。