khashayar ehteshami
khashayar ehteshami

Reputation: 187

How to get labels of model prediction in text format?

I have a model and I trained and saved it, now I just want to load it and then predict 1000 images file for me I load it by this code

loaded_model = tf.keras.models.load_model('dir') 

and I use this code for predicting my data

loaded_model.predict(test_dataset)

this code gives me back a NumPy array, How can I get labels that predict in the model. prediction as a text file.

Upvotes: 0

Views: 676

Answers (1)

Naga kiran
Naga kiran

Reputation: 4607

You can map the string to numerals followed by joining into text

', '.join(list(array.astype(str).flatten()))

', '.join(array.astype(str).flatten().tolist()))

Upvotes: 1

Related Questions