ARM-software / ML-KWS-for-MCU

Keyword spotting on Arm Cortex-M Microcontrollers
Apache License 2.0
1.13k stars 417 forks source link

update to TensorFlow 2 #140

Open upcoders opened 4 years ago

upcoders commented 4 years ago

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

Burton2000 commented 4 years ago

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

Aishaj commented 3 years ago

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

Burton2000 commented 3 years ago

@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)

Aishaj commented 3 years ago

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

Burton2000 commented 3 years ago

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