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

!2556 fix: change field name from 'data' to 'image' - sync

Merge pull request !2556 from guozhijian/fix_field_to_image_in_mindrecord
......@@ -26,8 +26,8 @@ import os
import pickle
######## mindrecord_schema begin ##########
mindrecord_schema = {"label": {"type": "int64"},
"data": {"type": "bytes"},
mindrecord_schema = {"label": {"type": "int32"},
"image": {"type": "bytes"},
"file_name": {"type": "string"}}
######## mindrecord_schema end ##########
......@@ -121,5 +121,5 @@ def mindrecord_dict_data(task_id):
if not image_bytes:
print("The image file: {} is invalid.".format(file_name))
continue
data["data"] = image_bytes
data["image"] = image_bytes
yield data
......@@ -114,7 +114,7 @@ class ImageNetToMR:
if not image_bytes:
logger.warning("The image file: {} is invalid.".format(file_name))
continue
data["data"] = image_bytes
data["image"] = image_bytes
yield data
def transform(self):
......@@ -126,8 +126,8 @@ class ImageNetToMR:
"""
t0_total = time.time()
imagenet_schema_json = {"label": {"type": "int64"},
"data": {"type": "bytes"},
imagenet_schema_json = {"label": {"type": "int32"},
"image": {"type": "bytes"},
"file_name": {"type": "string"}}
logger.info("transformed MindRecord schema is: {}".format(imagenet_schema_json))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册