Error using dnnfpga.compiler.codegenfpga. Layer 'block2b_add' has multiple inputs.
Show older comments
Hello,
I have a pretrained NN imported from TensorFlow. I have imported and replaced the only one placeholder layer and the DAGNetwork seems to be ok. However, when I try to compile the NN with Deep Learning HDL Toolbox, I get the following error:
Error using dnnfpga.compiler.codegenfpga
Layer 'block2b_add' has multiple inputs. Specify which input of layer 'block2b_add' to use.
Error in dnnfpga.apis.Workflow/compileNetwork
Error in dnnfpga.apis.Workflow/compile
Error in generate_HDL_from_NN (line 18)
hW.compile;
block2b_add has two inputs and connections are defined.
Could anyone help me to understand the issue?
Thank you in advance
---------------------------
Software version:
Deep Learning HDL Toolbox Support Package For Intel FPGA And SoC Devices 21.2.4
Matlab R2021b Update 6 (9.11.0.2207237)
Ubuntu 20.04
---------------------------
3 Comments
Aravind Devarakonda
on 4 May 2023
Hello Ruben
While attempting to load the provided network file, MATLAB encountered a warning :
"Unable to load instances of class EfficienB0_p1_C1.kRescalingLayer246310 into a heterogeneous array. The definition of EfficienB0_p1_C1.kRescalingLayer246310 could be missing or contain an error. Default objects will be substituted."
This warning appears when layer definition is missing or contains an error. To load network, provide definitions of all layers, including custom layers. Custom layer definitions are not included in link to download network file. Provide custom layer definitions along with network file to resolve issue.
Also, refer to the Custom layers documentation page for more information.
Let me know if you have questions. Thank you for your patience.
Aravind Devarakonda
on 12 May 2023
Hi Ruben
Thank you for replacing the network originally attached.
Regarding your inquiry, I have observed that the network given has a few layers that are not yet supported in the Deep Learning HDL Toolbox and are planned to be integrated in future updates.
These layers include :
1) Scaling Layer
2) Layer Normalization Layer
3) Swish Layer and,
4) FlattenCStyleLayer immediately followed by Convolution2DLayer is also not supported.
Currently, a flatten layer must be followed by either fully connected layer(s) or a join layer (eg. depth concatenation, addition) followed by fully connected layer(s).
As a workaround, I would suggest implementing the Scaling Layer as a custom layer by following the steps available on this documentation link -
https://in.mathworks.com/help/deep-learning-hdl/ug/create-deep-learning-processor-configuration-for-custom-layers.html
Regarding FlattenCStyleLayer immediately followed by Convolution2DLayer, I suggest replacing it with a fully connected layer.
Answers (1)
Rubén
on 3 May 2023
0 votes
Categories
Find more on Intel SoC Devices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!