Train Simple Audio Recognition - TinyML
@petewarden 
@dansitu  @siddarthnandy,
**tensorflow.contrib** is not available in tensorflow v2.x. Removed the old `tf.contrib.layers` and replace them with [TF Slim](https://github.com/google-research/tf-slim) symbols.

Could you please take a look at this official migration doc link which refers to the Migrate from TensorFlow 1.x to TensorFlow 2.
https://www.tensorflow.org/guide/migrate

Thank you!
 It is not straight forward on how to do this migration. Need some help. Thanks Has anyone else already completed the migration that I can use
 Need some help. Thanks. Still not resolved Need some help. Thanks. Still not resolved Need some help. Thanks. Still not resolved
 This issue is not resolved. Any help would be grateful. Hi @siddarthnandy 

The tensorflow [example](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/speech_commands) seems to be outdated. As @tilakrayal suggested we might have to look for TF 2.0 alternative.

However, the TinyML examples are provided in [tflite-micro](https://github.com/tensorflow/tflite-micro/tree/main) which is a port of TensorFlow Lite designed to run machine learning models on devices with limited memory. Please check this Simple Audio Recognition Model and let us know if it helps for your use case.

https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/examples/micro_speech/train/train_micro_speech_model.ipynb

Thanks. This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. will try it thanks Hi @siddarthnandy 

Did you get a chance to try the example?

Feel free to close the issue if it is resolved.

Thanks. This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. fixed thanks. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/61590">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/61590">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.12.0

### Custom code

Yes

### OS platform and distribution

Windows 11

### Mobile device

_No response_

### Python version

3.10.12

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

**Issue Report** - Error in Training Audio Recognition Model

**Description**:

I am trying to train a simple audio recognition model as described in the book "TinyML." I am using Google Colab to train the model. However, I encountered errors during both the installation of dependencies and the training process.

**Error during Install Dependencies**:

When attempting to install dependencies using the command 

!pip uninstall -y tensorflow tensorflow_estimator tensorboard
!pip install -q tf-estimator-nightly==1.14.0.dev2019072901 tf-nightly-gpu==1.15.0.dev20190729

 I encountered the following error:


ERROR: Could not find a version that satisfies the requirement tf-nightly-gpu==1.15.0.dev20190729 (from versions: 2.12.0)
ERROR: No matching distribution found for tf-nightly-gpu==1.15.0.dev20190729
Error during Training - ModuleNotFoundError:

**Error to Begin Training**:

Upon running the training script with TensorFlow in the "Begin Training" Section, I received the following error:

Traceback (most recent call last):
  File "/content/tensorflow/tensorflow/examples/speech_commands/train.py", line 81, in <module>
    import input_data
  File "/content/tensorflow/tensorflow/examples/speech_commands/input_data.py", line 35, in <module>
    from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
ModuleNotFoundError: No module named 'tensorflow.contrib'


**Observations**:

I suspect that these errors are occurring because the code provided in the book is intended for TensorFlow 1.15, while I am using TensorFlow 2.12.0. Since TensorFlow 1.15 is no longer supported. Not sure how I can resolve this. Please help me to fix this issue.

### Standalone code to reproduce the issue

```shell
https://colab.research.google.com/drive/1t2QMMiCdIxP3xnoNyiz9FjmPmbrF0_iD?usp=sharing
```


### Relevant log output

```shell
ERROR: Could not find a version that satisfies the requirement tf-nightly-gpu==1.15.0.dev20190729 (from versions: 2.12.0)
ERROR: No matching distribution found for tf-nightly-gpu==1.15.0.dev20190729





Traceback (most recent call last):
  File "/content/tensorflow/tensorflow/examples/speech_commands/train.py", line 81, in <module>
    import input_data
  File "/content/tensorflow/tensorflow/examples/speech_commands/input_data.py", line 35, in <module>
    from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
ModuleNotFoundError: No module named 'tensorflow.contrib'
```
