|
@@ -22,13 +22,14 @@ class ImageWrapper(object):
|
|
|
assert isfile(im_path), "Image \"{}\" does not exist!".format(im_path)
|
|
|
return _read()
|
|
|
else:
|
|
|
+ error = None
|
|
|
for i in range(n_retries):
|
|
|
try:
|
|
|
return _read()
|
|
|
except Exception as e:
|
|
|
- pass
|
|
|
+ error = e
|
|
|
|
|
|
- raise RuntimeError("Reading image \"{}\" failed after {} n_retries! ({})".format(im_path, n_retries, e))
|
|
|
+ raise RuntimeError("Reading image \"{}\" failed after {} n_retries! ({})".format(im_path, n_retries, error))
|
|
|
|
|
|
|
|
|
def __init__(self, im_path, label, parts=None, mode="RGB", part_rescale_size=None, center_cropped=True):
|