majianjia / nnom

A higher-level Neural Network library for microcontrollers.
Apache License 2.0
820 stars 235 forks source link

using DepthwiseConv2D for 1D data #172

Open AndreQingyuWu opened 1 year ago

AndreQingyuWu commented 1 year ago

When using DepthwiseConv2D for 1D data:

x.shape: TensorShape([None, 128, 64])

depthwise_kernel = (1, 3) x = Reshape((1, x.shape[1], x.shape[2]))(x) x = DepthwiseConv2D(kernel_size=depthwise_kernel, padding=padding)(x) x = Reshape((x.shape[2], x.shape[3]))(x) x =Conv1D(filters, kernel_size=kernel_size, padding=padding)(x)

An error occurred while running the auto_test example:

Program received signal SIGSEGV, Segmentation fault. 0x0000555555563ff9 in local_convolve_HWC_q7_nonsquare (Im_in=0x5555555cd160 "\377\022\371\371\377\003\342\037", dim_im_in_x=64, dim_im_in_y=128, ch_im_in=0, wt=0x55555556ca20 "\002\373\f\352\024\350\t\274\065\376\032\376\r\023\343\034P\371\325\025\301\v\r\021\022\310\003\006;\024\002\354\026\035\343\a\370\a\356\v\352/\n\375,+\b\353\004\023\352\370\372\004\311\032\033\062\027\356\021\006\377\340\r\354\343\031\023\334\023\306\022+\352\333\b\335\357\356;\333\370\024\005\020\333'\004\a\325\342\362\023\003\"ڵ/\030\"C\037,\344\022\376\022\035\357\032\374\344\375 \360\370\026\347\b\f\344\373\367\330\002\033\340\002\023\352\022\" \035\023\f\"\345\346\360\001\002\374\025\335\037\t\362\001\025\352\a\026\364\022\v\367\r\a,\373\312\005\356\354\355\355\373\331\035\064\027\362\376\332&\030\033\367\002\355#\r\364\360\031\373\355\016\346\355\b\375\027\026\377\351", <incomplete sequence \334>..., ch_im_out=64, dim_kernel_x=3, dim_kernel_y=1, padding_x=1, padding_y=0, stride_x=1, stride_y=1, dilation_x=1, dilation_y=1, bias=0x55555556fa40 "\032\347\273\360\006\367\367\030\033\036\367\323\005\364\004\377\001\v\350\025\034\336\033\n\342\037", bias_shift=0x55555556fa90 , out_shift=0x55555556fa8c , q_type=NNOM_QTYPE_PER_TENSOR, Im_out=0x5555555dd160 "4\017", dim_im_out_x=64, dim_im_out_y=128, bufferA=0x0, bufferB=0x0) at nnom/src/backends/nnom_local.c:491 491 Im_out[i + (j dim_im_out_x + k) ch_im_out] = (q7_t)__NNOM_SSAT((conv_out >> out_shift[shift_idx]), 8);