Reputation: 11
Here, I use opencv imread
read the all the image without any problem while it raise out Corrupt Data: xxx extraeous bytes before marker 0xd9 when training with neural networks. How could I get out these corrupt data(just select out, do not need repair or any other operations).
Upvotes: 1
Views: 2617
Reputation: 27547
Since you only want to filter out the corrupt files, you can use a try
- except
block:
for file in files:
try:
img = cv2.imread(file)
except:
pass
Upvotes: 1