在xml生成tfrecoed时出现如下错误:
代码
def create_tf_example(group, path):
with tf.gfile.GFile(os.path.join(path, '{}'.format(group.filename)), 'rb') as fid: #读图像
encoded_jpg = fid.read()
encoded_jpg_io = io.BytesIO(encoded_jpg)
image = Image.open(encoded_jpg_io)
width, height = image.size
主函数(改正后的):
通过查资料发现是程序中的路径使用了单反斜杠:
path = os.path.join(os.getcwd(), 'images\train')
把上面的路径改成
path = os.path.join(os.getcw