DigitalMediaProfessionals / tool

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

converter.py fails for NASNetMobile by Keras application #4

Closed YuyaKobayashi closed 5 years ago

YuyaKobayashi commented 6 years ago

Hi, all

I faced the below error on converting NASNetMobile by Keras application for DV.

INFO: normal_add_2_12        normal_add_2_12        Convolution  505 516 (4, 4, 176)        00009F80 00001600
INFO: normal_left3_12        normal_left3_12        Convolution  506 507 (5, 5, 176)        00002260 00002260
INFO: normal_add_3_12        normal_add_3_12        Convolution  507 516 (5, 5, 176)        0000B580 00002260
INFO: normal_left4_12        normal_left4_12        Convolution  508 510 (4, 4, 176)        00002260 00001600
INFO: normal_right4_12       normal_right4_12       Convolution  509 510 (4, 4, 176)        00003860 00001600
INFO: normal_add_4_12        normal_add_4_12        Convolution  510 516 (4, 4, 176)        0000D7E0 00001600
INFO: separable_conv_1_normal_left5_12 separable_conv_1_normal_left5_12 Convolution  511 512 (5, 5, 176)        00002260 00002260
INFO: separable_conv_1_normal_left5_12_point separable_conv_1_normal_left5_12_point Convolution  512 513 (5, 5, 176)        000044C0 00002260
INFO: separable_conv_2_normal_left5_12 separable_conv_2_normal_left5_12 Convolution  513 514 (5, 5, 176)        00002260 00002260
INFO: separable_conv_2_normal_left5_12_point separable_conv_2_normal_left5_12_point Convolution  514 515 (5, 5, 176)        000044C0 00002260
INFO: normal_add_5_12        normal_add_5_12        Convolution  515 516 (5, 5, 176)        0000EDE0 00002260
INFO: normal_concat_12       normal_concat_12       Concatenate  516 516 (4, 4, 1056)       00006720 0000A920*
INFO: allocated size:893216
Traceback (most recent call last):
  File "tool/convertor.py", line 134, in <module>
    output_gendoc, output_gengraph, graphviz_path)
  File "/home/yuya.kobayashi/git_repo/dv-sdk/tool/cnn_convertor/fpga_layer.py", line 1247, in output_network
    self.output_source(sf, network_name)
  File "/home/yuya.kobayashi/git_repo/dv-sdk/tool/cnn_convertor/fpga_layer.py", line 1215, in output_source
    gen_source_layer(of, name, n, layer, self.quantization)
  File "/home/yuya.kobayashi/git_repo/dv-sdk/tool/cnn_convertor/fpga_layer.py", line 696, in gen_source_layer
    gen_source_conv(of, name, n, layer, quantization)
  File "/home/yuya.kobayashi/git_repo/dv-sdk/tool/cnn_convertor/fpga_layer.py", line 534, in gen_source_conv
    '  conf.output_mode = 1;  // 0 = concat, 1 = eltwise add\n\n'.format(layer.layer_in[1].output_addr_offset))
IndexError: list index out of range

nasnetmobile.zip contains the following files.

Best regards, Kobayashi

ZongHong-Lyu commented 5 years ago

I pushed a branch to fix parts of issue.

There is one issue remain: The model uses Cropping2D layers, which is not supported by HW. It seems use the ZeroPadding and Cropping to ship pooling results and then concatenate those results. Since it is ignored by now, The converted network will be less precise.