Skip to content

Commit c651073

Browse files
plakalManoj Plakal
and
Manoj Plakal
authored
Switched YAMNet to stick with Keras 2. (#11261)
TF 2.16 switched the default to Keras 3 which is backwards incompatible. Co-authored-by: Manoj Plakal <[email protected]>
1 parent 951c619 commit c651073

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

research/audioset/yamnet/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ YAMNet depends on the following Python packages:
1515
* [`numpy`](http://www.numpy.org/)
1616
* [`resampy`](http://resampy.readthedocs.io/en/latest/)
1717
* [`tensorflow`](http://www.tensorflow.org/)
18+
* [`tf_keras`](https://github.com/keras-team/tf-keras)
1819
* [`pysoundfile`](https://pysoundfile.readthedocs.io/)
1920

2021
These are all easily installable via, e.g., `pip install numpy` (as in the
2122
example command sequence below). Any reasonably recent version of these
22-
packages should work.
23+
packages should work. Note that YAMNet currently relies on Keras 2 and is
24+
incompatible with Keras 3 (the default as of TF 2.16).
2325

2426
YAMNet also requires downloading the following data file:
2527

research/audioset/yamnet/yamnet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import numpy as np
2121
import tensorflow as tf
22-
from tensorflow.keras import Model, layers
22+
from tf_keras import Model, layers
2323

2424
import features as features_lib
2525

0 commit comments

Comments
 (0)