Print error when image read fails

This commit is contained in:
James Betker 2020-04-23 23:59:32 -06:00
parent e98d92fc77
commit ea54c7618a

View File

@ -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)