Skip to content

[bug] inconsistent preprocess_input #62

@qinst64

Description

@qinst64

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions