Skip to content

Zeros in moving_mean and moving_var in the batchnorm #1610

Open
@WassimBouatay

Description

@WassimBouatay

I am converting my model from the checkpoint file to an Onnx

I set the parameter is_train = False in the Class batch_norm of the file tf2onnx\onnx_opset\nn.py so that my batchnorm takes the moving_mean and moving_variance it learned during the training.
My first problem, is that in my onnx file, as you can see in the screenshot below: the moving_mean and moving_variance is all zeros. This is probably due to the graph optimization operations, because the input of the batch_norm node doesn't contain moving_mean and moving_variance, although they exist in the graph before the optimization.

My second problem, is that I don't understand why the name of the mean/var is the one of layer_108 instead of layer_1.

I am using:

  • Tensorflow Version: 1.15
  • Python version: 3.6
  • Opset 9

image

I am available to provide more information if you need. Thank you for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions