Skip to content

Cropping the mean file #1928

@lukeyeager

Description

@lukeyeager

Since the huge update, I'm having to fix lots of API changes with my python interfaces to caffe. How do I wade through the commit stream to find out what all needs to change?

This is my most recent problem. I try this:

classifier = caffe.Classifier(deploy_file, snapshot_file,
             image_dims      = (height, width),
             mean            = image_mean,
             raw_scale       = 255,
             channel_swap    = channel_swap,
             )
classifier.predict([image], oversample=False)

And I get this error:

ValueError: operands could not be broadcast together with shapes (3,227,227) (3,256,256) (3,227,227)

Apparently, the mean_file has to be cropped before passing it to the Classifier constructor now. How was I supposed to know that? I don't see it in any of these commits. And how am I supposed to do it? Should I be cropping it myself manually, or should I try to use Classifier.transformer.preprocess()?

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