'Example' object has no attribute 'SerializetoString'
tensorflow吧
全部回复
仅看楼主
level 2
lianbus 楼主
在用TFrecord 生成训练文件的时候遇到了这样的问题,我是参照别人的代码写得。
但是提示'Example' object has no attribute 'SerializetoString',
难道是我是1.3版本的tf,会和版本升级有关系么?
谢谢!
代码如下
/****
............
image_bytes=sess.run(tf.cast(resize_image,tf.uint8)).tobytes()
image_label=breed.encode("utf-8")
label0=tf.train.Feature(bytes_list=tf.train.BytesList(value=[image_label]))
image0=tf.train.Feature(bytes_list=tf.train.BytesList(value=[image_bytes]))
feature = {'label': label0, 'image': image0}
example=tf.train.Example(features=tf.train.Features(feature=feature))
writer.write(example.SerializetoString())
2017年11月10日 14点11分 1
1