breizhn / DTLN

Tensorflow 2.x implementation of the DTLN real time speech denoising model. With TF-lite, ONNX and real-time audio processing support.
MIT License
585 stars 161 forks source link

Issue with tflite interpreter #46

Open Vanajareddy0426 opened 3 years ago

Vanajareddy0426 commented 3 years ago

Hi, In DTLN model, I did some changes in separation kernel which looks as given below ` x = keras.layers.Conv1D( B, 1,use_bias=False )(x)

    y =  keras.layers.Conv1D(N, 1,use_bias=False  )(x)
    y =  keras.activations.relu(y, alpha = 0.01 ) 

    y =  InstantLayerNormalization()(y) 
    y =  keras.layers.Conv1D( N, kernel_size=P,  strides=1, padding= "causal", dilation_rate=2**0, groups=N,use_bias=False)(y) 

    y = keras.activations.relu(y, alpha = 0.01 )
    y = InstantLayerNormalization()(y)
    v = keras.layers.Conv1D( B, 1 ,use_bias=False)(y)
    z = y
    x = x + v

When I'm trying tflite convertion and tflite interpreter I'm getting error which is as mentioned below "RuntimeError: tensorflow/lite/kernels/conv.cc:238 input->dims->data[3] != filter->dims->data[3] (32 != 1)Node number 1 (CONV_2D) failed to prepare" I tried to debug the issue and understood that if I kept x = x+v or using v as the input for the next layers then I'm getting this error. (due to dilated convolution dependency with v)

1.How to resolve this error?

  1. If we cannot do it directly with tflite , then is there any alternative method for post quantization of model such as given above code?

Any help will be greatly appreciable . Thanks in Advance!