tensorflow / tensorflow/model-optimization

QAT (quantization aware training) Support quantizing models recursively

Open
#377 24 comments 0 reactions 1 assignee View on GitHub

@Xhark is already working on this.

Since Apr 14, 2021.

feature request technique:qat
Dominant language
Python
Stars
1.6k
Forks
349
Avg merge
3d 2h
Merged PRs (30d)
1

Description

Describe the bug
I'm doing transfer learning and would like to (at the end) quantize my model. The problem is that when I try to use the quantize_model() function (which is used successfully in numerous tutorials and videos), I get an error. How am I supposed to do quantization for transfer learning (using an already previously built model as a feature extractor)?

System information

TensorFlow installed from (source or binary): pip

TensorFlow version: tf-nightly 2.2.0

TensorFlow Model Optimization version: 0.3.0

Python version: 3.7.7

Describe the expected behavior
I expect the model to be successfully quantized and for no error messages to appear.

Describe the current behavior
I get the error: "ValueError: Quantizing a tf.keras Model inside another tf.keras Model is not supported."

Code to reproduce the issue
Can be found here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.