Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

converter.py fails for NASNetMobile by Keras application #4

Closed
YuyaKobayashi opened this issue Oct 2, 2018 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@YuyaKobayashi
Copy link
Collaborator

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.

  • nasnetmobile.hdf5 is a Keras network file.
  • nasnetmobile.ini is an input to converter.py.
  • convert.log is a full log file on the conversion.

Best regards,
Kobayashi

@ZongHong-Lyu ZongHong-Lyu self-assigned this Nov 13, 2018
@ZongHong-Lyu ZongHong-Lyu added the bug Something isn't working label Nov 13, 2018
ZongHong-Lyu pushed a commit that referenced this issue Nov 13, 2018
Fix #4
Fix a bug that pooling layer is merged with convolution layer that does
not use that layer as input layer.

Fix ZeroPadding layers parsing in Keras so the layer that use it can
correctly get the padding info if the ZeroPadding is not directly
followed by the layer that use it.
@ZongHong-Lyu
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants