title: CV2 Image Error: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'
body: <p>I'm making an image classifier with TensorFlow and Python, but I'm having an error reading images with CV2. I'm very new to CV2, and I haven't been able to find anything that sufficiently solves my problem. Can anyone explain how to solve this?</p>
  <pre class="lang-py prettyprint-override"><code>def train_data_with_label():
    train_images = []
    for i in tqdm(os.listdir(train_data)):
      path = os.path.join(train_data, i)
      img = cv2.imread(path, 3)
      img = cv2.resize(img, (64,64))
      train_images.append([np.array(img), one_hot_label(i)])
    shuffle(train_images)
    return train_images
    
  def test_data_with_label():
    test_images = []
    for i in tqdm(os.listdir(test_data)):
      path = os.path.join(test_data, i)
      img = cv2.imread(path, 3)
      img = cv2.resize(img, (64,64))
      test_images.append([np.array(img), one_hot_label(i)])
    shuffle(test_images)
    return test_images
  </code></pre>
  <p>This is the error I got:</p>
  <pre class="lang-none prettyprint-override"><code>Using TensorFlow backend.
    0%|                                                                                            | 0/2 [00:00&lt;?, ?it/s]
  Traceback (most recent call last):
    File &quot;retrain.py&quot;, line 47, in &lt;module&gt;
      training_images = train_data_with_label()
    File &quot;retrain.py&quot;, line 32, in train_data_with_label
      img = cv2.resize(img, (64,64))
  cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'
  </code></pre>