From ea54c7618acd0b6ae5d7c5d3bc28a6d7c3df987e Mon Sep 17 00:00:00 2001 From: James Betker Date: Thu, 23 Apr 2020 23:59:32 -0600 Subject: [PATCH] Print error when image read fails --- codes/data/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codes/data/util.py b/codes/data/util.py index 516c6ae9..181896b1 100644 --- a/codes/data/util.py +++ b/codes/data/util.py @@ -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)