ML-KWS-for-MCU icon indicating copy to clipboard operation
ML-KWS-for-MCU copied to clipboard

update to TensorFlow 2

Open upcoders opened this issue 4 years ago • 5 comments

Is there an update to work with tensorflow version 2, especially for train.py? Indeed, the most problematic line is from tensorflow.contrib import slim as slim because there is no compatibility for this library between v1 and v2 of tf. I think other parts can be simply upgraded to version 2. Thanks

upcoders avatar Jul 18 '20 06:07 upcoders

See https://github.com/ARM-software/ML-examples/tree/master/tflu-kws-cortex-m for tf2 version of training and quantizing.

Burton2000 avatar Nov 09 '20 14:11 Burton2000

@Burton2000 Thanks, but how can I use the pre-trined models in the TensorFlow2 code?

Aishaj avatar Jul 22 '21 13:07 Aishaj

@Aishaj You can use the tflite files with the test_tflite.py file to evaluate the model accuracy on the test set or use the ckpt files with test.py, check the README in the Training folder for more details. You need to make sure the same arguments from training are used with test or test_tflite (see train_commands.txt)

Burton2000 avatar Jul 26 '21 11:07 Burton2000

@Burton2000 Thanks, we would also appreciate adding label_wav.py file for TensorFlow 2 version. THank you

Aishaj avatar Jul 27 '21 11:07 Aishaj

Yep if that is something that will be of use we will look to add that as well when we have some time.

Burton2000 avatar Jul 27 '21 13:07 Burton2000