tensorflow/models · error · ValueError
No images found in any folder for dataset
Error message
No images found in any folder for dataset {dataset_name!r}. What it means
A ValueError from process_dataset: after processing all folders, no train/val split was produced, meaning no images existed anywhere in the dataset — so splitting is pointless and downstream stages would get an empty classifier dataset.
Solutions
- Add images to the dataset's input folders before running.
- Check keep_every_nth/train_ratio settings aren't filtering everything out.
- Verify the source folders contain supported image files.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/split_train_val.py:373 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24).
Data as JSON: /api/errors/bb0ae7c3e41096f0.
Report an issue: GitHub.
Appendix: source
Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/split_train_val.py:373
folder_label = os.path.basename(source_folder.rstrip(os.sep))
folders_to_process = [(source_folder, folder_label)]
# First pass: check all duplicates before copying anything.
all_splits = []
for folder_path, folder_label in folders_to_process:
result = process_folder(
folder_path,
folder_label,
train_folder,
val_folder,
keep_every_nth,
train_ratio,
)
if result is not None:
all_splits.append(result)
if not all_splits:
raise ValueError(
f"No images found in any folder for dataset {dataset_name!r}."
)
# Second pass: copy files.
dataset_train_count = 0
dataset_val_count = 0
for split in all_splits:
folder_label, folder_path, train_image_names, val_image_names = split
print(
f"[{folder_label}] {len(train_image_names)} train, "
f"{len(val_image_names)} val"
)
copy_files(train_image_names, folder_path, train_folder)
copy_files(val_image_names, folder_path, val_folder)
dataset_train_count += len(train_image_names)View on GitHub (pinned to e006f5f0d5)