Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving key error #4

Open
DhruvMakwana opened this issue Feb 28, 2020 · 1 comment
Open

Receiving key error #4

DhruvMakwana opened this issue Feb 28, 2020 · 1 comment

Comments

@DhruvMakwana
Copy link

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?

@ethanyanjiali
Copy link
Owner

@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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants