# Warning during training a CNN

I was training a CNN when the following appeared:

after this the training continue, but I don't understand why it happens. Should I do something or leave it?

[EDIT] The problem is that it does this also during the evaluation, so for example if I want to print the confusion matrix:

Y_pred = model.predict_generator(test_generator, test_generator.n //
batch_size+1)
y_pred = np.argmax(Y_pred, axis=1)
print('Confusion Matrix')
print(confusion_matrix(test_generator.classes, y_pred))


I get the error:

Thanks.

[EDIT] I have 3200 images for training and 800 images for testing. So I don't understand what is happenining here because this error should happen for the fact that y_test and y_pred have different number of elements, so why it says that one has 832 elements, since I have only 800 images for testing?

• There are some images with corrupt EXIF data. The images will be skipped. No need to worry if this does not happen too often. – Peter Dec 8 '19 at 12:16
• thanks for answering. The problem is that this happens also in testing, so I have the problem that I lose images during testing. I have edited my question with more details. – J.D. Dec 9 '19 at 20:20
• Maybe try writing a script that checks if the images (both train and test sets) are ok or not. You can output the filename of the images that failed the test (corrupted files) into a text file and manually check and fix them. – atmarges Dec 10 '19 at 11:53