I am building an image processing classifier. This line is giving me an error:
input_img_resize=cv2.resize(input_img,(128,128))
The error:
If you are working with several images (for example, 1000 images), it may be difficult for you to identify which image is giving you problems. It may also be that, there are several others that are corrupt. In such a case, the code below can be useful.
for file in filenames:
try:
image = cv2.resize(cv2.imread(file), (size, size))
except:
print(file)
where filenames is a list which contains names of the images.