Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Does caffe_converter reads the input data dimensions of the model in a right way? #227

@ToPP13

Description

@ToPP13

Good evening.

I have faced the problem of the right network reconstruction. It seems that caffe converter makes mistakes with the input data dimensions.

I have trained the lenet-like network, using caffe and DIGITS interface. I have used my own dataset with the images like
0

They are 24 pixels wide and 40 pixels height.

However the caffe uses another dimension order(may be not that evident) - not the width x height but the other way around. This is described here:

The conventional blob dimensions for batches of image data are number N x channel K x height H x width W

in the chapter "Blob storage and communication".

The same I see in the deploy.prototxt file of my network:

input: "data"
input_shape {
dim: 1
dim: 1
dim: 40
dim: 24
}

However I see that in the caffe_converter the input picture is first resized (24,40) -> (40,24).
This is done in the:
void preprocess(...) in caffe_converter.cpp
called by void test(...) in caffe_converter.cpp
called by main(...) in caffe_converter.cpp

There I see that the size of the network stores in:
net->in_shape().width_

the "net" was assigned by the
create_net_from_caffe_prototxt(...) in layer_factory.h
that uses create_net_from_caffe_net(...) in in layer_factory.h

There I see:

int depth = static_cast(layer.input_shape(0).dim(1));
int width = static_cast(layer.input_shape(0).dim(2));
int height = static_cast(layer.input_shape(0).dim(3));

Could that be the place that caused the mistake?

I'm sorry if I'm wrong, I am just trying to make the model work.

P.S. it seems that the "power" layer is not supported by the caffe_converter. Is it planned to add it in the future?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions