0

我正在尝试使用自定义数据集的 Tensorflow 对象检测 API,并且目前在从 xml 文件生成 .record 文件的同一位置遇到了几个教程。

对于图像标记,我使用了以 Pascal VOC 格式设置的labelImg

有几个脚本可以进行这样的转换,比如在名为generate_tfrecord.py的文档中(它是作为文本编写的),但是它和其他一些脚本在两个过时的行中无法使用 tensorflow 2 运行:

# the first 
flags = tf.app.flags
# second at the end of the document
tf.app.run()

我可以先修复

from absl import app, flags
flags = app.flags

但是即使您使用app.run()错误,最后一个也会失败TypeError: run() missing 1 required positional argument: 'main'

由于我只有一个简单的自定义数据集,我认为我不能使用object_detection/dataset_tools/create_pascal_tf_record.py它,因为它需要一年的帕斯卡数据集,并且可能还需要特定的数据集结构。

是否有用于生成 .record 的脚本与 Tensorflow 2 一起使用,或者您能否指出我如何修复这些脚本以与 Tensorflow 2 一起使用?

4

0 回答 0