UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
145 Views
Registered: ‎08-02-2019

DNNC error: [out_type && in_type]

Jump to solution

Hi,

I am trying to run a fully connected network by converting some of the dense layers to conv2D layers as DNNC requires a convolution layer.

otherwise I get this error:

[DNNC][Fatal] Check failed for condition [infer_shape_handler != nullptr] in [/tmp/DNNDK_Pipeline_dnnc/dnnc/dnnc_impl/core/layer.cc:163] :Infer shape handler for [Convolution] is missing.

I am using DNNDK-v3.1. and tensorflow.

According to this post: https://forums.xilinx.com/t5/Machine-Learning/Compiling-a-Non-Convolutional-Network/m-p/971434#M856 

I converted this model:

Layer (type)                     Output Shape                        Param #
=================================================================
reshape_1 (Reshape)     (None, 50, 512)                          0
_________________________________________________________________
flatten_1 (Flatten)           (None, 25600)                            0
_________________________________________________________________
dense_1 (Dense)              (None, 512)                          13107712
_________________________________________________________________
dense_2 (Dense)             (None, 1024)                            525312
_________________________________________________________________
dense_3 (Dense)             (None, 512)                              524800
_________________________________________________________________
dense_4 (Dense)              (None, 2)                                   1026
=================================================================

to this one:

Layer (type)                      Output Shape                        Param #
=================================================================
reshape_1 (Reshape)    (None, 50, 512, 1)                     0
_________________________________________________________________
conv2d_1 (Conv2D)        (None, 1, 1, 512)                   13107712
_________________________________________________________________
conv2d_2 (Conv2D)        (None, 1, 1, 512)                    262656
_________________________________________________________________
conv2d_3 (Conv2D)        (None, 1, 1, 512)                    262656
_________________________________________________________________
flatten_2 (Flatten)              (None, 512)                            0
_________________________________________________________________
dense_4 (Dense)                 (None, 512)                        262656
_________________________________________________________________
dense_5 (Dense)                   (None, 2)                            1026
=================================================================

Now when I run the deploy.pb of the above model I am getting the following error:

[DNNC][Fatal] Check failed for condition [out_type && in_type] in [/tmp/DNNDK_Pipeline_dnnc/dnnc/dnnc_impl/transform/transformer.cc:784] :

I don't understand what should be done now! Please help me.

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
81 Views
Registered: ‎11-29-2007

Re: DNNC error: [out_type && in_type]

Jump to solution

hello,

your problem comes from the fact that DPU does not directly support Flatten+FC layers, but it converts them with a 2D conv layer with 1x1 kernel.

The combination with next FC layer (this also replaced with CONV2D layer) causes a violation of the max input size (16x16) of the CONV layer.

Could you try to keep your data shape more squared (replace 1x512 with 23x22 for example) or to replace the Flatten-FC-FC sequence with a mix of 2D convolutional and max pooling layers?

thanks

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
82 Views
Registered: ‎11-29-2007

Re: DNNC error: [out_type && in_type]

Jump to solution

hello,

your problem comes from the fact that DPU does not directly support Flatten+FC layers, but it converts them with a 2D conv layer with 1x1 kernel.

The combination with next FC layer (this also replaced with CONV2D layer) causes a violation of the max input size (16x16) of the CONV layer.

Could you try to keep your data shape more squared (replace 1x512 with 23x22 for example) or to replace the Flatten-FC-FC sequence with a mix of 2D convolutional and max pooling layers?

thanks

0 Kudos