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)