1
$\begingroup$

I was training a CNN when the following appeared:

enter image description here

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:

enter image description here

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?

| improve this question | | | | |
$\endgroup$
  • 1
    $\begingroup$ There are some images with corrupt EXIF data. The images will be skipped. No need to worry if this does not happen too often. $\endgroup$ – Peter Dec 8 '19 at 12:16
  • $\begingroup$ 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. $\endgroup$ – J.D. Dec 9 '19 at 20:20
  • $\begingroup$ 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. $\endgroup$ – atmarges Dec 10 '19 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.