小编fde*_*che的帖子

Tensorflow:FixedLenFeature字节数值!=预期

我尝试从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)

我刚刚遵循了https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/how_tos/reading_data/fully_connected_reader.py

但是之后

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'引起

有什么问题(我知道我可以提及实际尺寸,但我不想要这个)吗?

python arrays file-io tensorflow

0
推荐指数
1
解决办法
1942
查看次数

标签 统计

arrays ×1

file-io ×1

python ×1

tensorflow ×1