DigitalMediaProfessionals / tool

DV network conversion tool
Apache License 2.0
0 stars 1 forks source link

The converter generate negative padding value with Keras MobileNetV2 #3

Closed YuyaKobayashi closed 6 years ago

YuyaKobayashi commented 6 years ago

I was trying to convert MobileNetV2 by Keras application to DV network as below.

$ python3 ./converter.py mobilenet.ini

Then I got Mobilenetv2Feature_gen.cpp but building the code failed due to gramatical error. The below code is the part of the code. The 3rd line contains erroneous code.

  conf.run[0].weight_buf.offs = 0;
  conf.run[0].weight_fmt = 3;  // Weight format (0 = random access blocks, 1 = compact stream, 3 = 8-bit qunatized stream)
  conf.run[0].conv_pad = 0x-10001;  // bits [7:0] = left padding, bits [15:8] = right padding, bits [23:16] = top padding, bits [31:24] = bottom padding
  conf.run[0].conv_stride = 0x202;  // bits [7:0] = X stride, bits [15:8] = Y stride
  conf.run[0].conv_dilation = 0x0;  // bits [7:0] = X dilation, bits [15:8] = Y dilation

Could you fix this?

I attached mobilenet.zip including the following files.

Thank you, Kobayashi

ZongHong-Lyu commented 6 years ago

The cause is that the padding is asymmetric, which is not supported by the current tool.

BenTokyo commented 6 years ago

Hi Lyu,

Can we start putting those items in the issue list on wiki? Thank you.

Ben.

On Tue, Oct 9, 2018 at 2:28 PM ZongHong-Lyu notifications@github.com wrote:

The cause is that the padding is asymmetric, which is not supported by the current tool.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DigitalMediaProfessionals/tool/issues/3#issuecomment-428064631, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7dowZ3OzBE9u3ZLs4Sk7erX4w0iK7Iks5ujDQGgaJpZM4XDdX4 .

ZongHong-Lyu commented 6 years ago

Hi Benjamin,

This is not HW limitation but tool issue, so if I fixed it, the issue is gone. Do you still think that we need to keep a wiki page for these? I think wiki page should only list non-solvable limitation or issues?

BenTokyo commented 6 years ago

Hi Lyu,

If you fix it straight away, no need to push the issue on wiki. It is not to forget about issues.

I think wiki page should only list non-solvable limitation or issues? Sorry, i did not mean wiki page. I meant github / issue report.

Br, BN.

On Tue, Oct 9, 2018 at 3:54 PM ZongHong-Lyu notifications@github.com wrote:

Hi Benjamin,

This is not HW limitation but tool issue, so if I fixed it, the issue is gone. Do you still think that we need to keep a wiki page for these? I think wiki page should only list non-solvable limitation or issues?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DigitalMediaProfessionals/tool/issues/3#issuecomment-428081040, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7do_h41o9b_CUExY8Lj-9tRMeVqw17ks5ujEgigaJpZM4XDdX4 .

ZongHong-Lyu commented 6 years ago

Hi Benjamin,

So, at least for the tools, I am already filing issues that are reported or known by me. I am not sure if one needs write access to file a new issue. If not, then anyone in the team should be able to file a issue.

ZongHong-Lyu commented 6 years ago

The current implementation assumes symmetric padding in various places. It is not so easy to fix it since I'd like to have more tests.

ZongHong-Lyu commented 6 years ago

Now the tool does not generate negative padding values, but there are some warning about not supported layers. Need to add support of Keras ReLU, Note that not all parameters are supported. And in this model, it needs to be mapped to ReLU6