EfficientNet-PyTorch icon indicating copy to clipboard operation
EfficientNet-PyTorch copied to clipboard

Normalize input using numpy only for onnx inference.

Open sagunkayastha opened this issue 4 years ago • 1 comments

I have retrained an efficentnet-b1 model on a custom dataset using pre-trained weights. It works fine and gives correct result when i normalize the image using the torch transform with transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]).

but when i use simple numpy normalization the outputs are worng. img -= [0.485, 0.456, 0.406] img /= [0.229, 0.224, 0.225]

What am I doing wrong here?

Thanks in advace.

sagunkayastha avatar Dec 15 '20 06:12 sagunkayastha

Hi, I'm happy to help. Can you give a complete reproducible example?

lukemelas avatar Dec 21 '20 18:12 lukemelas