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

[bug] inconsistent preprocess_input #62

Open
qinst64 opened this issue Dec 10, 2017 · 2 comments
Open

[bug] inconsistent preprocess_input #62

qinst64 opened this issue Dec 10, 2017 · 2 comments

Comments

@qinst64
Copy link

qinst64 commented Dec 10, 2017

in the quiver code quiver_engine/imagenet_uitls.py:

x[:, :, :, 0] -= 103.939
x[:, :, :, 1] -= 116.779
x[:, :, :, 2] -= 123.68
# 'RGB'->'BGR'
x = x[:, :, :, ::-1]

in keras keras/applications/imagenet_utils.py:

# 'RGB'->'BGR'
x = x[..., ::-1]
 # Zero-center by mean pixel
x[..., 0] -= 103.939
x[..., 1] -= 116.779
x[..., 2] -= 123.68

minus+transpose and transpose+minus are apparently different, which leading prediction different results beween quiver vs. keras. However, I am not sure which of them is right.

@jakebian
Copy link
Member

Yeah looks like Keras is right, good catch, fixing.

@qinst64
Copy link
Author

qinst64 commented Dec 11, 2017

@jakebian Vgg16 is going great but when I use keras.applications.inception_v3 as the quiver input, the prediction is not as expected (quite bad).

Then I compared inception_v3.py and vgg16.py and find actually their preprocess_input are different. On the other hand, I may or may not use imagenet_util.preprocess_input for my own models.

I guess one solution is letting preprocess_input be a paramerer of quiver_engine.server.launch so one can apply custermized pre-processing.

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