-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
TFJS - How to create model for custom word(Speech commands model) #1717
Comments
Could you give a bit more detail and describe how you did the retraining? Did you use the transfer learning api or something different. A code snippet would be great for us to get a better sense of what may be going on. Also how many samples/examples do you have for each of the words in your vocabulary? |
We download the speech data set from https://storage.cloud.google.com/download.tensorflow.org/data/speech_commands_v0.02.tar.gz and added one more folder called wakeup with 500 samples and trained the data we followed this tutorial to train the data .
We got model.json and weights.bin files. Loaded model.json ,weights.bin and metadata.json in SpeechCommands.js and called the prediction using below code snippet. let recognizer; function predictWord() { recognizer.listen(({scores}) => { async function app() { app(); We are not able detect any keywords like up,down or left and right. Please let me if anything wrong in the training process ? or do we need to train more steps ? We dint use transfer learning api. |
Thanks for the information @ranjithrengaraj a few things stand out to me.
It is surprising that you don't get the original words being recognized. Were you able to get the base model working without modification.
Apologies for how confusing this all is. |
Thanks tafsiri. Were you able to get the base model working without modification. - Yes we are able to detect the keyword without modification. speechCommands.create('BROWSER_FFT','directional4w'); will load the existing pretrained recognizer. I don't see how it connects to the metadata and model you created. Could you add a snippet for how you did the following? - We have loaded custom model using loadLayersModel .Same method working for pre trained model but not custom training model. this.modelURL='http://localhost:28440/model.json' Someway i loaded metadata.json also. |
I'm also interested in figuring out how to train a model that can later be loaded in the browser. I was able to train and save model following the README in the training/soft-fft directory, though it appears that functionality is not yet supported by speechCommands. I looked into training/browser-fft but there appears to be a missing step:
Anywhere you can point me to figure the best way to run the WebAudio FFT on the processed files? |
@caisq gentle ping ! Did you get chance to look at this ? |
+1 to @nsteins question. Some pointers would be great! |
I'm also interested in some details regarding WebAudio FFT. Stuck at step 3: |
Closing this due to lack of activity, feel to reopen. Thank you |
Like others on this thread, I'm also still unclear about step 3 on this README:
Could someone please provide additional details on that step of training? Thanks so much. |
Hello, I would also be interested in further information about step 3 of data preparation : "Run WebAudio FFT on the .dat files generated in step 2 in the browser. TODO(cais): Provide more details here." Does anyone have any idea or indications on how to do this given the available code? Would be greatly appreciated |
To get help from the community, we encourage using Stack Overflow and the
tensorflow.js
tag.TensorFlow.js version
Node version : V12.4.0
Browser version
Describe the problem or feature request
I used the audio_model which has been given in https://github.com/tensorflow/tfjs-models/tree/master/speech-commands.
Followed the document and train the model with custom word like (wakeup) with existing dataset and saved the model.
1 . Create_model wakeup up down left right
2. loaded the dataset
3. train 100
4. save_model
Model json and weights.bin got generated then i imported the model in js but its not detecting any word.
Please suggest how to train custom word and how much training epoch required.
Code to reproduce the bug / link to feature request
The text was updated successfully, but these errors were encountered: