Skip to content

pycaffe preprocessing incorrect for certain options in master (fixed in dev) #867

@shelhamer

Description

@shelhamer

In master the pycaffe preprocessing for deployment nets -- models that use input: fields instead of data layers -- is incorrect for certain combinations of input scaling and means.

  • pycaffe scales the input before mean subtraction, instead of after
  • pycaffe represents images as floats in [0, 1], while some Caffe models represent images in [0, 255] -- most notably the ImageNet models

However when the input scale in master is set to 255 this reproduces the correct behavior for the ImageNet models.

This bug does not affect models that use data layers as the input preprocessing is handled by ForwardPrefilled() and the data layers instead of pycaffe's Net.preprocess().

Input preprocessing in Python is fixed and merged to dev in #816. A new stable release is on the way, but in the meantime pycaffe users working with deployment nets should try dev to ensure correct model output.

Sorry for the bug! Thanks to @Denominator for a report.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions