deep-vision icon indicating copy to clipboard operation
deep-vision copied to clipboard

Receiving key error

Open DhruvMakwana opened this issue 5 years ago • 1 comments

KeyError Traceback (most recent call last) in 1 if name == 'main': ----> 2 main()

in main() 28 for xml_file in os.listdir('../input/voc2012/VOC2007/Annotations'): 29 image_id = xml_file[:-4] ---> 30 if train_val_split[image_id] == 'train': 31 train_annotations.append(parse_one_xml(xml_file, names_map)) 32 elif train_val_split[image_id] == 'val':

KeyError: '008664'

how can I solve it?

DhruvMakwana avatar Feb 28 '20 05:02 DhruvMakwana

@DhruvMakwana it looks like the original dataset annotation is off

could you check if you have 008664 when you read the original annotation from this part of the code? I noticed that you put the dataset under ../input/voc2012, you'll need to do the same the code below too

with open('./VOCdevkit/VOC2012/ImageSets/Main/train.txt') as train_fp:
        lines = train_fp.read().splitlines()
        for line in lines:
            train_val_split[line] = 'train'

ethanyanjiali avatar Mar 03 '20 20:03 ethanyanjiali