Print error when image read fails

pull/9/head
James Betker 2020-04-23 23:59:32 +07:00
parent e98d92fc77
commit ea54c7618a
1 changed files with 2 additions and 0 deletions

@ -79,6 +79,8 @@ def read_img(env, path, size=None):
img = cv2.imread(path, cv2.IMREAD_UNCHANGED)
else:
img = _read_img_lmdb(env, path, size)
if img is None:
print("Image error: %s" % (path,))
img = img.astype(np.float32) / 255.
if img.ndim == 2:
img = np.expand_dims(img, axis=2)