TensorflowBaseDemo icon indicating copy to clipboard operation
TensorflowBaseDemo copied to clipboard

MakeTFRecord2.py 中label定义语句ubuntu下错误

Open miss-peret opened this issue 5 years ago • 0 comments

修正了label定义语句 label = transform_label(totalList[dictlist[i]].split('\')[1].split('-')[0]) 在ubuntu下即使修正"\"为"/"仍然报错,split函数操作较为麻烦,所以改为 label = transform_label(total_list[dict_list[i]].split('img')[1].split('-')[0])

相应的: def transform_label(imgType): label_dict = { 'img001': 0, 'img002': 1, 'img003': 2, 'img004': 3, 'img005': 4, 'img006': 5, 'img007': 6, 'img008': 7, 'img009': 8, 'img010': 9, 'img011': 10, } return label_dict[imgType]

改为: def transform_label(img_type): label_dict = { '001': 0, '002': 1, '003': 2, '004': 3, '005': 4, '006': 5, '007': 6, '008': 7, '009': 8, '010': 9, } return label_dict[img_type]

miss-peret avatar May 16 '19 07:05 miss-peret