title: I am having trouble with this error (-215:Assertion failed) !ssize.empty() in function 'resize' in OpenCV
body: <p>I am trying to apply a Keras' image classifier to my project, but down the road I got stuck with this. Though previously, with the same code I could use OpenCV to read and train images, but after switching to a new batch of images it got caught with the error. So my speculation is that there's something wrong with my file type:</p>
  <p>This is from the batch that got the error:</p>
  <blockquote>
  <p>traf.204.jpg: JPEG image data, JFIF standard 1.01, aspect ratio,
  density 1x1, segment length 16, baseline, precision 8, 480x294, frames
  1</p>
  </blockquote>
  <p>This is from the batch that didn't get caught with the error:</p>
  <blockquote>
  <p>bear.290.jpg: JPEG image data, JFIF standard 1.01, aspect ratio,
  density 1x1, segment length 16, baseline, precision 8, 224x224, frames
  3</p>
  </blockquote>
  <p>But the file type seems to be exactly the same (except for the resolution). How can I fix this problem?</p>