提交 e8172b3e 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!661 fix imagenet to mindrecord fail when the pic size is 0

Merge pull request !661 from guozhijian/fix_imagenet_to_mindrecord_fail
......@@ -111,6 +111,9 @@ class ImageNetToMR:
image_file = open(file_name, "rb")
image_bytes = image_file.read()
image_file.close()
if not image_bytes:
logger.warning("The image file: {} is invalid.".format(file_name))
continue
data["data"] = image_bytes
yield data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册