Le-Xiaohuai-speech / DPCRN_DNS3

Implementation of paper "DPCRN: Dual-Path Convolution Recurrent Network for Single Channel Speech Enhancement"
180 stars 40 forks source link

About lite #26

Open panhu opened 2 years ago

panhu commented 2 years ago

Hi,I want to ask a question。how to convert tflite about the model of RNN? i have a new model of RNN,but when i converted tflite,the file of Tflite ratio H5 is much larger。do you know the question? thank you

panhu commented 2 years ago

Hi, when i want to convert TFLite,have some questions.this is my code: model = tf.keras.models.load_model(modelparh,custom_objects={'DprnnBlock':DprnnBlock,'stftLayer':stftLayer,'mk_mask':mk_mask,'ifftLayer':ifftLayer,'overlapAddLayer':overlapAddLayer})

the error is: TypeError: stftLayer() missing 1 required positional argument: 'x'

how can i modify those functions? Thanks

Le-Xiaohuai-speech commented 2 years ago

the stft layer can not be converted correctly, and I omitted it in my tflite. you can override the stft and istft by Conv1d.

---Original--- From: @.> Date: Sat, Jul 9, 2022 11:52 AM To: @.>; Cc: @.***>; Subject: Re: [Le-Xiaohuai-speech/DPCRN_DNS3] About lite (Issue #26)

Hi, when i want to convert TFLite,have some questions.this is my code: model = tf.keras.models.load_model(modelparh,custom_objects={'DprnnBlock':DprnnBlock,'stftLayer':stftLayer,'mk_mask':mk_mask,'ifftLayer':ifftLayer,'overlapAddLayer':overlapAddLayer})

the error is: TypeError: stftLayer() missing 1 required positional argument: 'x'

how can i modify those functions? Thanks

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

panhu commented 2 years ago

Hi, I used "model.save()" to save my model.But,when i want to convert TFLite, can not load my model.

model = tf.keras.models.load_model(modelparh,custom_objects={'DprnnBlock':DprnnBlock,'stftLayer':stftLayer,'mk_mask':mk_mask,'ifftLayer':ifftLayer,'overlapAddLayer':overlapAddLayer})

the error is: TypeError: stftLayer() missing 1 required positional argument: 'x'

why do i can not load my model? Thanks

panhu commented 2 years ago

the stft layer can not be converted correctly, and I omitted it in my tflite. you can override the stft and istft by Conv1d. ---Original--- From: @.> Date: Sat, Jul 9, 2022 11:52 AM To: @.>; Cc: @.>; Subject: Re: [Le-Xiaohuai-speech/DPCRN_DNS3] About lite (Issue #26) Hi, when i want to convert TFLite,have some questions.this is my code: model = tf.keras.models.load_model(modelparh,custom_objects={'DprnnBlock':DprnnBlock,'stftLayer':stftLayer,'mk_mask':mk_mask,'ifftLayer':ifftLayer,'overlapAddLayer':overlapAddLayer}) the error is: TypeError: stftLayer() missing 1 required positional argument: 'x' how can i modify those functions? Thanks — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>

Hi,can you tell me how to override the stft and istft by Conv1d? like this?

outputs = tf.nn.conv1d(inputs, self.weight, stride=self.stride,padding='VALID')

Le-Xiaohuai-speech commented 2 years ago

like this: https://github.com/echocatzh/conv-stft

panhu commented 2 years ago

Hi, am i need to chage torch to tensorflow? "like this: https://github.com/echocatzh/conv-stft"?