FoundationAgents/MetaGPT · error · ValueError
Dataset {dataset_name} not found in config file. Available d
Error message
Dataset {dataset_name} not found in config file. Available datasets: {config['datasets'].keys()} What it means
Raised by the SELA dataset loader when the requested dataset_name is not a key in the loaded config's 'datasets' mapping (the datasets.yaml registry). The message lists the datasets that ARE available so the mismatch is visible.
Source
Thrown at metagpt/ext/sela/data/dataset.py:128
def get_split_dataset_path(dataset_name, config):
datasets_dir = config["datasets_dir"]
if dataset_name in config["datasets"]:
dataset = config["datasets"][dataset_name]
data_path = os.path.join(datasets_dir, dataset["dataset"])
split_datasets = {
"train": os.path.join(data_path, "split_train.csv"),
"dev": os.path.join(data_path, "split_dev.csv"),
"dev_wo_target": os.path.join(data_path, "split_dev_wo_target.csv"),
"dev_target": os.path.join(data_path, "split_dev_target.csv"),
"test": os.path.join(data_path, "split_test.csv"),
"test_wo_target": os.path.join(data_path, "split_test_wo_target.csv"),
"test_target": os.path.join(data_path, "split_test_target.csv"),
}
return split_datasets
else:
raise ValueError(
f"Dataset {dataset_name} not found in config file. Available datasets: {config['datasets'].keys()}"
)
def get_user_requirement(task_name, config):
# datasets_dir = config["datasets_dir"]
if task_name in config["datasets"]:
dataset = config["datasets"][task_name]
# data_path = os.path.join(datasets_dir, dataset["dataset"])
user_requirement = dataset["user_requirement"]
return user_requirement
else:
raise ValueError(
f"Dataset {task_name} not found in config file. Available datasets: {config['datasets'].keys()}"
)
def save_datasets_dict_to_yaml(datasets_dict, name="datasets.yaml"):View on GitHub (pinned to 11cdf466d0)
Solutions
- Use one of the dataset names printed in the error message (they are the available keys)
- Register your dataset in the datasets config yaml with its 'dataset', 'target_col' and 'user_requirement' entries
- Check for typos/case differences in the task name passed on the CLI
Example fix
# before (task not registered)
datasets = get_split_datasets("abaline", config)
# after
datasets = get_split_datasets("abalone", config) Defensive patterns
Strategy: validation
Validate before calling
if dataset_name not in config["datasets"]:
raise KeyError(f"unknown dataset {dataset_name}; known: {sorted(config['datasets'])}") Type guard
def is_registered_dataset(name: str, config: dict) -> bool:
return name in config.get("datasets", {}) Prevention
- Derive task names programmatically from config['datasets'].keys() instead of typing them
- Register new datasets in datasets.yaml before referencing them
When it happens
Trigger: Calling the split-dataset helper with a task/dataset name that is not registered, e.g. get_split_datasets('abalone', config) or a custom OpenML dataset that was never added to datasets.yaml.
Common situations: Typos in --task; using a task name from a different fork/branch of datasets.yaml; forgetting to register a newly added dataset in config/datasets.yaml.
Related errors
- Dataset {task_name} not found in config file. Available data
- Target column not provided
- Number of classes {num_classes} not supported
- Invalid exp_mode: {args.exp_mode}
- Dataset {task_name} not found in config file. Available data
AI-assisted analysis of FoundationAgents/MetaGPT@11cdf466d0 (2026-08-14).
Data as JSON: /api/errors/4155b55bd27de524.
Report an issue: GitHub.