如何读取FSNS / TFRecord数据?

问题描述

我想为项目使用法国街名数据集(FSNS),并尝试从TFRecords-links(请参阅https://git.mif.vu.lt/TankBusterPBL/TankBuster/tree/8ba53a7dbc5e73043eb61b22f4280aea97f28840/bin/Tensorflow/Tensorflow/street)中获取数据。

我的目标是a)对FSNS有所了解,b)在pytorch中使用它。 关于a):如何观看单个示例(=图片)?在哪里可以找到注释?

我尝试了很多尝试,并遇到了以下问题:

  1. 我是这种事物的新手,以前从未使用过张量流。
  2. 我发现了很多有关如何创建数据的材料,但是没有有关如何读取数据的材料(例如:How to create dataset in the same format as the FSNS dataset?)。
  3. 从TF2开始,很多事情似乎不再起作用。

我尝试了以下链接:https://gist.github.com/Prasad9/62ac6fa51e4c6fd435630bf4588d884c 并使用将其更改为TF2 tf_upgrade_v2 --infile main.py --outfile out.py,但目录为空。然后,我使用Tensorflow record: how to read and plot image values?,导致出现了很多错误。

我读了this tutorial,并尝试应用此方法:

reader = tf.data.TFRecordDataset("test-00000-of-00064")
for raw_record in reader.take(1):
    example = tf.train.Example()
    example.ParseFromString(raw_record.numpy())
    image_raw = raw_record["image/encoded"].numpy()

但是会发生此错误:

TypeError: Only integers,slices (`:`),ellipsis (`...`),tf.newaxis (`None`) and scalar tf.int32/tf.int64 tensors are valid indices,got 'image/encoded'

引用Tensorflow record: how to read and plot image values?

我的意思是,数据在那里,仅将其拉出并显示出来有多困难?我想我缺少真正明显的东西。

非常感谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...