未验证 提交 80714b00 编写于 作者: B Bai Yifan 提交者: GitHub

fix reader hang issue when data path is not valid (#205)

上级 292cc150
......@@ -100,7 +100,11 @@ def distort_color(img):
def process_image(sample, mode, color_jitter, rotate):
img_path = sample[0]
img = Image.open(img_path)
try:
img = Image.open(img_path)
except:
print(img_path, "not exists!")
return None
if mode == 'train':
if rotate: img = rotate_image(img)
img = random_crop(img, DATA_DIM)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册