import sys
import tensorflow as tf
def main():
filepath = './'
with () as sess:
filenames = [filepath]
# 加载TFRecord数据
ds = (filenames)
# 读取N条
ds = (8)
ds = (buffer_size=)
iterator = ds.make_one_shot_iterator()
batch_data = iterator.get_next()
res = (batch_data)
for i in range(0, [0]):
print('-------------------第%d条数据-----------------'%i)
serialized_example = res[0]
example_proto = (serialized_example)
features = example_proto.features
print('{0} 信息如下:'.format(filepath))
for key in :
feature = [key]
ftype, fvalue = None, None
if len(feature.bytes_list.value) > 0:
ftype = 'bytes_list'
fvalue = feature.bytes_list.value
if len(feature.float_list.value) > 0:
ftype = 'float_list'
fvalue = feature.float_list.value
if len(feature.int64_list.value) > 0:
ftype = 'int64_list'
fvalue = feature.int64_list.value
result = '{0} : {1} : {2}'.format(key, ftype, fvalue)
print(result)
if __name__ == "__main__":
main()