Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About lite #26

Open
panhu opened this issue Jul 5, 2022 · 6 comments
Open

About lite #26

panhu opened this issue Jul 5, 2022 · 6 comments

Comments

@panhu
Copy link

panhu commented Jul 5, 2022

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
Copy link
Author

panhu commented Jul 9, 2022

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
Copy link
Owner

Le-Xiaohuai-speech commented Jul 9, 2022 via email

@panhu
Copy link
Author

panhu commented Aug 22, 2022

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
Copy link
Author

panhu commented Aug 24, 2022

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
Copy link
Owner

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

@panhu
Copy link
Author

panhu commented Sep 8, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants