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

base_model.label("./context_images", extension=".jpg") TypeError: expected str, bytes or os.PathLike object, not ClassificationDataset #1

Open
cobaltautomationdev opened this issue Jan 4, 2024 · 1 comment

Comments

@cobaltautomationdev
Copy link

base_model.label("./context_images", extension=".jpeg") not work.

Classifications(class_id=array([0, 1]), confidence=array([4.3924967e-05, 9.9995613e-01], dtype=float32))
Labeling ./context_images/test.jpg: 100%|██████████| 2/2 [00:01<00:00, 1.92it/s]

TypeError Traceback (most recent call last)
in <cell line: 21>()
19
20 print(results)
---> 21 base_model.label("./context_images", extension=".jpg")

2 frames
/usr/lib/python3.10/posixpath.py in join(a, *p)
74 will be discarded. An empty last part will result in a path that
75 ends with a separator."""
---> 76 a = os.fspath(a)
77 sep = _get_sep(a)
78 path = a

TypeError: expected str, bytes or os.PathLike object, not ClassificationDataset

@cobaltautomationdev
Copy link
Author

classification_base_model.py

your function split_data in this py not support dataset.

train_cs, test_cs = split_data(dataset, split_ratio=0.7)
train_cs, test_cs = split_data(output_folder, split_ratio=0.7)

you should change it to
train_cs, test_cs = dataset.split(split_ratio=0.7, shuffle=True)

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