pred = model.predict(test_ds)
pred = np.argmax(pred, axis = -1)
from sklearn import preprocessing
le = preprocessing.LabelEncoder()
le.fit(dataset.class_names)
class_names = le.transform(dataset.class_names)
class_names = np.argmax(class_names,axis = -1)
class_names = class_names.reshape(-1,1)
from sklearn.metrics import classification_report
print(classification_report(class_names,pred))
Trying to generate classification_report but Error that I get is the following:
ValueError: Found input variables with inconsistent numbers of samples: [1, 261]
Description Dataset: images: 2691, class_names: ['apple','orange','banana']
pred :[2 2 1 0 1 2 1 2 1 1 1 1 2 2 1 0 0 1 0 2 2 1 0 0 2 2 1 1 1 2 1 2 2 0 2 2 2 0 0 2 0 2 2 2 1 2 1 1 1 2 2 2 2 2 2 1 1 0 2 1 1 2 0 0 2 2 1 0 1 0 1 1 0 1 1 1 0 0 2 1 2 0 1 2 0 0 2 2 1 2 0 1 2 2 0 0 1 0 1 1 1 1 1 2 2 0 2 1 2 1 0 0 2 1 0 2 2 1 2 1 2 2 1 2 1 1 2 2 2 2 2 0 1 2 0 2 1 1 0 0 1 2 0 2 1 0 1 2 2 1 2 2 1 0 2 1 0 2 0 0 1 1 2 1 0 1 2 2 2 2 2 1 2 0 0 0 2 1 1 2 2 1 2 2 1 2 2 2 1 1 1 1 0 2 2 0 2 1 2 0 0 1 0 2 0 0 2 0 2 1 2 2 1 0 1 1 0 1 1 0 1 0 1 0 2 1 0 1 1 1 2 2 1 2 0 1 2 2 2 1 2 0 0 1 2 1 2 0 0 0 1 0 2 1 0 0 1 0 2 2 2]
class_names: [0 1 2]