Training custom wake word fails

Having an issue training a custom wake word at Google Colab
Have re nun the coustome word training several times over several days
Keeps failing with this error.
Checked the Dir and the ‘my_custom_model/hey_i_fearnan.onnx’ does not exist

`
FileNotFoundError Traceback (most recent call last)
in <cell line: 92>()
90 return None
91
—> 92 convert_onnx_to_tflite(f"my_custom_model/{config[‘model_name’]}.onnx", f"my_custom_model/{config[‘model_name’]}.tflite")
93
94 # Automatically download the trained model files

2 frames
/usr/local/lib/python3.10/dist-packages/onnx/init.py in _load_bytes(f)
71 content = typing.cast(IO[bytes], f).read()
72 else:
—> 73 with open(typing.cast(str, f), “rb”) as readable:
74 content = readable.read()
75 return content

FileNotFoundError: [Errno 2] No such file or directory: ‘my_custom_model/hey_i_fearnan.onnx’
`

I am getting the same error.

made some edits. Still running the training, but appears to be working. Will remove this comment if it fails:

Sorry nope still getting it
TensorFlow Addons (TFA) has ended development and introduction of new features.
TFA has entered a minimal maintenance and release mode until a planned end of life in May 2024.
Please modify downstream libraries to take dependencies from other repositories in our TensorFlow community (e.g. Keras, Keras-CV, and Keras-NLP).

For more information see: TensorFlow Addons Wind Down · Issue #2807 · tensorflow/addons · GitHub

warnings.warn(
/usr/local/lib/python3.10/dist-packages/tensorflow_addons/utils/ensure_tf_install.py:53: UserWarning: Tensorflow Addons supports using Python ops for all Tensorflow versions above or equal to 2.12.0 and strictly below 2.15.0 (nightly versions are not supported).
The versions of TensorFlow you are currently using is 2.8.1 and is not supported.
Some things might work, some things might not.
If you were to encounter a bug, do not file an issue.
If you want to make sure you’re using a tested and supported configuration, either change the TensorFlow version or the TensorFlow Addons’s version.
You can find the compatibility matrix in TensorFlow Addon’s readme:
GitHub - tensorflow/addons: Useful extra functionality for TensorFlow 2.x maintained by SIG-addons
warnings.warn(

FileNotFoundError Traceback (most recent call last)
in <cell line: 94>()
92 return None
93
—> 94 convert_onnx_to_tflite(f"my_custom_model/{config[‘model_name’]}.onnx", f"my_custom_model/{config[‘model_name’]}.tflite")
95
96 # Automatically download the trained model files

2 frames
/usr/local/lib/python3.10/dist-packages/onnx/init.py in _load_bytes(f)
32 s = cast(IO[bytes], f).read()
33 else:
—> 34 with open(cast(str, f), “rb”) as readable:
35 s = readable.read()
36 return s

FileNotFoundError: [Errno 2] No such file or directory: ‘my_custom_model/i_fearnan.onnx’

in case anyone ends up here: The original colab has been edited, and mine is invalid. Check the openwakeword github issues for details.

I was able to use tensorflow v2.15.0 (was using 2.8…x) and generate the onnx file by tweaking the dependencies as follows (install section)

install other dependencies

!pip install mutagen==1.47.0
!pip install torchinfo==1.8.0
!pip install torchmetrics==1.2.0
!pip install speechbrain==0.5.14
!pip install audiomentations==0.33.0
!pip install torch-audiomentations==0.11.0
!pip install acoustics==0.2.6
!pip uninstall tensorflow -y
!pip uninstall keras -y
!pip install keras==2.15.0
!pip install tensorflow-cpu==2.15.0

!pip install --upgrade tensorboard
!pip install --upgrade tensorflow-estimator
!pip install --upgrade google-auth-oauthlib
!pip install --upgrade tensorboard
!pip install onnx_tf==1.10.0
!pip install pronouncing==0.2.0
!pip install datasets==2.14.6
!pip install deep-phonemizer==0.0.19

However, with these new versions the conversion onnx > tflite fails
more specifically, line
convert_onnx_to_tflite(f"my_custom_model/{config[‘model_name’]}.onnx", f"my_custom_model/{config[‘model_name’]}.tflite")

fails with the following messages :
ValueError Traceback (most recent call last)

in <cell line: 1>()
----> 1 convert_onnx_to_tflite(f"my_custom_model/{config[‘model_name’]}.onnx", f"my_custom_model/{config[‘model_name’]}.tflite")

17 frames

/usr/local/lib/python3.10/dist-packages/tensorflow_probability/python/internal/prefer_static.py in _copy_docstring(original_fn, new_fn)
89 new_spec = tf_inspect.getfullargspec(new_fn)
90 if original_spec != new_spec:
—> 91 raise ValueError(
92 ‘Arg specs do not match: original={}, new={}, fn={}’.format(
93 original_spec, new_spec, original_fn))

ValueError: Arg specs do not match: original=FullArgSpec(args=[‘input’, ‘dtype’, ‘name’, ‘layout’], varargs=None, varkw=None, defaults=(None, None, None), kwonlyargs=, kwonlydefaults=None, annotations={}), new=FullArgSpec(args=[‘input’, ‘dtype’, ‘name’], varargs=None, varkw=None, defaults=(None, None), kwonlyargs=, kwonlydefaults=None, annotations={}), fn=<function ones_like_v2 at 0x79bb254d3010>

The Collab AI suggests the following
The error message Arg specs do not match indicates a mismatch between the arguments of the original tf.ones_like function and the new _ones_like function defined in the tensorflow_probability package.

To fix this issue, you need to ensure that the arguments of _ones_like match those of tf.ones_like. Specifically, the layout argument should be removed from the _ones_like function definition.

Any clue what is happening ? It looks like the # of arguments has changed with the TF version. I’m too noob to propose any change to the existing code but has anyone been able to correct that ?

Thanks :slight_smile: