-
Notifications
You must be signed in to change notification settings - Fork 123
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
How to get args.r_mean, args.g_mean and args.b_mean? #7
Comments
The args.r_mean, args.g_mean and args.b_mean are computed on training images of DIV2K dataset. For the challenge, we use parser.add_argument('--r_mean', type=float, default=0.4488,
help='Mean of R Channel')
parser.add_argument('--g_mean', type=float, default=0.4371,
help='Mean of G channel')
parser.add_argument('--b_mean', type=float, default=0.4040,
help='Mean of B channel') |
Thanks |
Hi,if I want to train it with other dataset,how to set the r_mean, g_mean, b_mean attribute values of args? or how to compute the value?And why we need these mean values?I am confused with it |
I have the same confusion. |
Then you need to calculate the mean values for R, G, B channels for the entire dataset. If the values are between 0-255, you should also divide by 255 to make them between 0-1. Subtracting the mean value from the input yields zero-mean input, which provides a more stable training. More importantly, if you are using a pretrained network which was trained with zero-mean input, then the input you provide should also be zero-mean otherwise the results' pixel values will be shifted. |
Hi, Jiahui,
When I run wdsr_a, there is a error:
Making model...
Traceback (most recent call last):
File "D:/project/pytorch/SR/EDSR-m/src/main.py", line 27, in
main()
File "D:/project/pytorch/SR/EDSR-m/src/main.py", line 17, in main
model = model.Model(args, checkpoint)
File "D:\project\pytorch\SR\EDSR-m\src\model_init_.py", line 24, in init
self.model = module.make_model(args).to(self.device)
File "D:\project\pytorch\SR\EDSR-m\src\model\wdsr_a.py", line 42, in init
[args.r_mean, args.g_mean, args.b_mean])).view([1, 3, 1, 1])
AttributeError: 'Namespace' object has no attribute 'r_mean'
Then How can I to get args.r_mean, args.g_mean and args.b_mean?
Thanks!
The text was updated successfully, but these errors were encountered: