Skip to content
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

data pre-processing before finetuning, divide by 255? #79

Open
qiyang77 opened this issue Apr 14, 2019 · 2 comments
Open

data pre-processing before finetuning, divide by 255? #79

qiyang77 opened this issue Apr 14, 2019 · 2 comments

Comments

@qiyang77
Copy link

Hello, I use python 3.6 + tensorflow 1.9.0 to do a classification task by finetuning Alexnet. In kratzert's srouce code, the range of data is [0,255] and the image is substracted
by meanfile[103,116,123]. However, in my case, I perform better accrucy when the input images divide by 255 after substracted mean(distribution is [-0.5,0.5]). If the input images did not divide by 255 (distrubution is [-128, 128]), the results is bad and more easily to suffer Nan problem in summary operation when the learning rate is higher then 0.001.
The question is should I scale the image ?

@kratzert
Copy link
Owner

You probably should, yes. Not sure why I missed to do this here, since I'm doing this usually. But better than dividing by 255 you should divide by the per-channel standard deviation.

@qiyang77
Copy link
Author

Thank u very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants