Skip to content

KeyError: '2963f9e8361b2b11bd01f8dbd610fb2e39dcffb1.jpg' #1

@haijiecheng

Description

@haijiecheng

when I python train.py
--model_name=resnet50
--optim=Adam
--learning_rate=1e-3
--num_epochs=10
Build a Dataset: Image Enhance:False
Traceback (most recent call last):
File "train.py", line 263, in
main()
File "train.py", line 243, in main
train_loss, train_acc_1, train_acc_3 = train_epoch(model, dataset, optimizer, logger=logger)
File "train.py", line 34, in train_epoch
dataloader = dataset.get_dataloader()
File "/home/chenghj/scene-classification/dataset.py", line 154, in get_dataloader
is_train=True)
File "/home/chenghj/scene-classification/dataset.py", line 188, in init
imgs = make_dataset(root, over_sample, class_to_idx, is_train)
File "/home/chenghj/scene-classification/dataset.py", line 48, in make_dataset
index = class_to_idx[target]
KeyError: '2963f9e8361b2b11bd01f8dbd610fb2e39dcffb1.jpg'
please tell me how to solve it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions