-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalization of input images in scratch trainings #9
Comments
I don't understand why this should be prevented? Under what circumstance should we not normalize like this? Are you saying the PyTorch ImageNet training script is also wrong? https://github.com/pytorch/examples/blob/master/imagenet/main.py#L202 |
No no, I am not saying training script over Imagenet is wrong. I think when we are training a CNN like deeplab on say cityscapes training set "from scratch", we do not have to normalize the images before training using imagenet's mean and std, instead we need to normalize them using cityscapes's mean and std. |
Yes using Cityscapes mean and std should be better. Do you have those values calculated? |
Here are the values for cityscapes training on 2975 images:
The code for calculating is https://github.com/SorourMo/Useful-statistics-on-public-datasets/blob/master/mean_std_cityscapes.py |
Hi there,
Thanks you for sharing the code. It seems the
preprocess
inutils.py
automatically normalizes the images using Imagenet mean and std values regardless of the state of training. If the training is started from scratch (no pretrained weights are required), still the mean and std of images are gonna used for normalization.DeepLabv3.pytorch/utils.py
Line 73 in 046818d
A simple flag could be added to prevent this. I'd be happy to pull request for that. Please let me know if you are interested in adding that flag.
The text was updated successfully, but these errors were encountered: