Print error when image read fails
This commit is contained in:
parent
e98d92fc77
commit
ea54c7618a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user