我尝试从tfrecords文件加载示例。我有一个类似的阅读器功能:
def read_record(filename_queue):
reader = tf.TFRecordReader()
key, record_string = reader.read(filename_queue)
features = {
"feature": tf.FixedLenFeature([], dtype=tf.string),
}
ex_dict = tf.parse_single_example(record_string, features)
ex_feature = tf.decode_raw(ex_dict["feature"], tf.float32)
return ex_feature
Run Code Online (Sandbox Code Playgroud)
但是之后
example_features = read_record(filename_queue)
values = sess.run({"features":example_features})
Run Code Online (Sandbox Code Playgroud)
停止并显示以下错误:
InvalidArgumentError:名称:,键:功能,索引:0。字节数!! =预期值。值大小:4096,但输出形状:[]由op u'ParseSingleExample / ParseExample / ParseExample'引起
有什么问题(我知道我可以提及实际尺寸,但我不想要这个)吗?