tensorflow / tensorflow/model-optimization

Depthwise convolution min_max dimension

Open
#808 2 comments 0 reactions 1 assignee View on GitHub

@Xhark is already working on this.

Since Sep 1, 2021.

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

Description

Hello,
i met a new issue when i tried to translate the weight of a pytorch model after QAT to a keras model.
My model contains a depthwise convolution layer and it's weight shape is 334801 as showed in .h5 file. In QAT stage, the fake noded will be construced according to this shape, so the dimension of depthwise_kernel_min and depthwise_kernel_max will be 1. I found it is because the Default8BitConvQuantizeConfig will build the shape based on the weight tensor_shape[-1].
However, in per_axis way, the depthwise_kernel_min and depthwise_kernel_max should be tensor_shape[-2]. As for above example, the dimension of depthwise convolution is 3
34801, so the dimension of depthwise_kernel_min and depthwise_kernel_max should be 480. In pytorch, the depthwise convolution kernel_min and kernel_max are also 480.
So it confused me when i tried to translate the weight of pytorch to a keras model.

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.