Skip to content

Quantize layer disapeared when convert tensorflow QAT to ONNX QAT #1394

@Phincle

Description

@Phincle

tensorflow QAT model like:
【model 1】
[data] [weights]
| |
[FakeQuantWithMinMaxVars] [FakeQuantWithMinMaxVars]
\ /
[ conv2d ]

I hope it to be onnx QAT model like this after convert:
【model 2】
[data] [weights]
| |
[QuantizeLinear] [QuantizeLinear]
| |
[DequantizeLinear] [DequantizeLinear]
\ /
[ conv2d ]

But it turned to be like:
【model 3】
[data]
|
[QuantizeLinear]
|
[DequantizeLinear]
\
[ conv2d ]

Seems like weight has const folded .
I noticed that there is an arg in tf2onnx.convert :

--fold_const Deprecated. Constant folding is always enabled.

Does this have anything to do with it?

please help, thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending on user responseWaiting for more information or validation from user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions