question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement ops for converted audio models: Mfcc, DecodeWav, AudioSpectrogram

See original GitHub issue

TensorFlow.js version

0.3.0

Describe the problem or feature request

I generated a model using the “Simple Audio Recognition” tutorial, which I’d like to run in a browser. I tried to convert it for use with TensorFlow.js, but I had some issues loading the model when I ran the tensorflowjs-converter, as described in this issue: https://github.com/tensorflow/tfjs/issues/246.

I tried resolving this by adding the line: from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio to converters/converter.py in the tensorflowjs pip package. This fixed the exception when loading the model and now the converter lists the missing ops:

Unsupported Ops in the model
Mfcc, DecodeWav, AudioSpectrogram

Could these ops be implemented for TensorFlow.js?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
davidsoergelcommented, May 10, 2018

Thanks for the request! We are working to expand the coverage of TensorFlow Ops in TF.js. I can’t say when these will be done, but user feedback does help up prioritize.

I vaguely recall that spectrograms are a special case-- @nsthorat, was this one of those situations where the browser implementation differs subtly from the TF implementation and so breaks imported models?

0reactions
kongkipcommented, Nov 9, 2019

Hi, Instead of doing that, I created a package by extending tf.keras.layers.Layer by creating an audio preprocessor which generates spectrograms and it turned out that the ops are in TFlite.

On DecodeWav, I preprocess the data before basing through the spectrogram layer hence the not included when converting the model to TFlite.

On Tue, 22 Oct 2019, 19:34 Naveen Singh, notifications@github.com wrote:

@kongkip https://github.com/kongkip You got anything yet?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/tfjs/issues/271?email_source=notifications&email_token=AIELQNOMQ535BXTJSSQUERLQP4TQXA5CNFSM4E6V7AQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB6MI6Q#issuecomment-545047674, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIELQNN4V4VV3BR425SEHCLQP4TQXANCNFSM4E6V7AQQ .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom, converted tflite model causing an AudioClassifier ...
I had a .pb model which I converted to a .tflite model. ... implementation 'org.tensorflow:tensorflow-lite-task-audio:0.3.0' implementation ...
Read more >
tf.audio.decode_wav | TensorFlow v2.11.0
Decode a 16-bit PCM WAV file to a float tensor. View aliases. Compat aliases for migration. See Migration guide for more details. tf....
Read more >
Audio Spectrogram Transformer - Hugging Face
The Audio Spectrogram Transformer applies a Vision Transformer to audio, by turning audio into an image (spectrogram). The model obtains state-of-the-art ...
Read more >
Audio spectrogram — NVIDIA DALI 1.20.0 documentation
A spectrogram is a representation of a signal (e.g. an audio signal) that shows ... We can use DALI's MFCC operator to transform...
Read more >
How to run GPU accelerated Signal Processing in TensorFlow
We walked through each step from decoding a WAV file to computing MFCCs features of the ... audio/signal processing pipeline for you TensorFlow/Keras...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found