AryaAftab / LIGHT-SERNET

Light-SERNet: A lightweight fully convolutional neural network for speech emotion recognition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I trained in Colab and get models, but how do I test these models ?

kananmammad opened this issue · comments

I trained in Colab and get models, but how do I test these models ?

@AryaAftab
Hi, please help for test models

@kananmammad
Hi, kananmammad
The best model in 10 fold-cross validation was saved in TFLite format. You can use the TensorFlow lite tutorial in this site to learn how to deploy your trained TensorFlow Lite model on edge devices such as mobile and Raspberry Pi. If you have more questions feel free and ask.

@AryaAftab I don't have Rasperry PI, I use Ubuntu 20.04.3 LTS
There is train model with code in your project, but there isn't test the model with code

python train.py -dn "IEMOCAP" \
                -id 7 \
                -at "impro" \
                -ln "cross_entropy" \
                -v 1 \
                -it "mfcc"

Please, tell me how do I test this model with code ?

Inside the train.py file, the desired model is evaluated in each fold after training, and confusion matrices were saved in result folder. For a separate test, you can use the functions prepared in tflite_evaluate.py to evaluate your model:

Example:

from tflite_evaluate import evaluate_model

BuffX = ... # Your mfccs (size : (batch_size, n_frame, n_mfcc, 1))
BuffY = ... # Your Labels (size : (batch_size, ))

evaluate_model(best_modelname_float32, model_type="float32", test_audios=BuffX, test_labels=BuffY)