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

fix val.py bug #517

Open
regainOWO opened this issue Dec 28, 2022 · 0 comments
Open

fix val.py bug #517

regainOWO opened this issue Dec 28, 2022 · 0 comments

Comments

@regainOWO
Copy link

regainOWO commented Dec 28, 2022

I found create_dataloader function param names variable type is list, but in val.py line 161

names = {k: v for k, v in enumerate(model.names if hasattr(model, 'names') else model.module.names)}

now names is a dict, this will make error if you didn't train A dataset before, if you train A dataset before, it will create label cache and create_dataloader will load label cache, no errors will occur.
maybe it in line 167, it can change to

dataloader = create_dataloader(data[task], imgsz, batch_size, stride, list(names.values()), single_cls, pad=pad, rect=pt,
                                       workers=workers, prefix=colorstr(f'{task}: '))[0]
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

1 participant