In Pytorch no normalize but has toTensor

I converted the PyTorch to CoreML and then used it in my iOS project.
But I found in PyTorch there is no normalize code to do image preprocess , so it means I should do image preprocess option in CoreML.
Does it have same effect between toTensor and Normalize

You can do image normalization with torchvision.transforms.Normalize(mean, std, inplace=False), if that’s what you want to do.

@Marc_Dumon

my model file without scaler
standard model file
I met one weird issue - I input the image and then predict wrongly.I used CoreML but the model doesn’t have scaler

@ptrblck

Could you rephrase because I have no idea what your problem is.

@Marc_Dumon because onnx doesn’t support preprocess so in CoreML I must do the job manually.So I mean the model doesn’t have scaler.

In pytorch you can do normalization, resizing etc with torchvision.transforms.

Yeah ,if don’t do normalization ,what will happen ?