When plotting confusion matrix I got this error , if I set batch size is 624 and steps = 1 then code
runs fine but if I set batch size 32 and steps 20 then I got this error why ? I have total 624
test images of two classes normal and penumonia
test_batch= ImageDataGenerator(preprocessing_function=tf.keras.applications.vgg16.preprocess_input)
.flow_from_directory(directory=test_path, target_size=(224,224), classes=['NORMAL', 'PNEUMONIA'],
batch_size=32, shuffle=False)
assert train_batch.n == 3616
assert val_batch.n == 1616
assert test_batch.n == 624
assert train_batch.num_classes == val_batch.num_classes == test_batch.num_classes == 2
test_imgs , test_labels = next(test_batch)
test_labels = test_labels[:,0]
prediction = model.predict_generator(test_batch,steps=20)
cm = confusion_matrix (test_labels, prediction[:,0])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…