ermig1979 / Synet

A small framework to infer neural network
MIT License
137 stars 26 forks source link

Wrong output from StubLayer #25

Closed edward9112 closed 2 years ago

edward9112 commented 2 years ago

Hello,

I tried to use the following model: Expected output: Name: age_conv3, shape: 1, 1, 1, 1 - Estimated age divided by 100. Name: prob, shape: 1, 2, 1, 1 - Softmax output across 2 type classes [0 - female, 1 - male].

Received output example: age_conv3 = [0.349784911, 0.328657120, 0.373537451, 0.369158268] (4 values instead of one) prob = [0.0271999519, 0.972800076, 0.0115807839, 0.988419175, 0.0321026519, 0.967897415, 0.0114557156, 0.988544285] (8 values instead of 2)

The question is, why do I receive such output? Maybe I use wrong output processing for StubLayer?

Thank you

ermig1979 commented 2 years ago

Hi! I added this model to tests (see https://github.com/ermig1979/Synet/tree/master/data/inference_engine/test_016f). The model is processed normally with expected output sizes: (1 1 1 1, 1 2 1 1).

However I found that this model can be resized to another input size (internal structure of this model allows to do this) and this leads to wrong output size. So I would check size of input. It must be (1 3 62 62 for NCHW) or (1 62 62 3 for NHWC). This model allows to change only batch size.

edward9112 commented 2 years ago

I double-checked, and it works as expected, thank you!