{"record":{"id":"5e2ab265a5d56d52","repo":"geekcomputers/Python","slug":"unknown-dataset-name","errorCode":null,"errorMessage":"Unknown dataset: {name}","messagePattern":"Unknown dataset: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"ML/src/python/neuralforge/data/datasets.py","lineNumber":132,"sourceCode":"    def __getitem__(self, idx):\n        return self.dataset[idx]\n\ndef get_dataset(name='cifar10', root='./data', train=True, download=True):\n    name = name.lower()\n    \n    if name == 'cifar10':\n        return CIFAR10Dataset(root=root, train=train, download=download)\n    elif name == 'cifar100':\n        return CIFAR100Dataset(root=root, train=train, download=download)\n    elif name == 'mnist':\n        return MNISTDataset(root=root, train=train, download=download)\n    elif name == 'fashion_mnist' or name == 'fashionmnist':\n        return FashionMNISTDataset(root=root, train=train, download=download)\n    elif name == 'stl10':\n        split = 'train' if train else 'test'\n        return STL10Dataset(root=root, split=split, download=download)\n    else:\n        raise ValueError(f\"Unknown dataset: {name}\")\n\nclass ImageNetDataset:\n    def __init__(self, root='./data/imagenet', split='train', transform=None, download=False):\n        if transform is None:\n            if split == 'train':\n                transform = transforms.Compose([\n                    transforms.RandomResizedCrop(224),\n                    transforms.RandomHorizontalFlip(),\n                    transforms.ColorJitter(0.4, 0.4, 0.4),\n                    transforms.ToTensor(),\n                    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])\n                ])\n            else:\n                transform = transforms.Compose([\n                    transforms.Resize(256),\n                    transforms.CenterCrop(224),\n                    transforms.ToTensor(),\n                    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/geekcomputers/Python/blob/40f4cd2652d75ef8e49d76e5c4d431d458712719/ML/src/python/neuralforge/data/datasets.py#L114-L150","documentation":"Raised by get_dataset in neuralforge.data.datasets when the requested dataset name does not match any of the supported aliases in this factory branch (cifar10, mnist, fashion_mnist/fashionmnist, stl10, etc.). The name is matched exactly against the elif chain, so any unrecognized or misspelled string falls through to ValueError.","triggerScenarios":"Calling get_dataset('fashion-mnist') (hyphen instead of underscore), 'CIFAR10' if the name is not lowercased before dispatch, or a dataset like 'imagenet' handled by a different factory/branch.","commonSituations":"Typos or wrong separators in config files; dataset name sourced from a CLI arg without normalization; expecting a dataset that exists in the library but is served by another factory function (e.g. the get_dataset variant at line 302 covering caltech256/oxford_pets).","solutions":["Print/lowercase the name and compare against the supported list in this factory","Use exact aliases: 'fashion_mnist' or 'fashionmnist', 'stl10'","If you want caltech256/oxford_pets, call the other get_dataset/factory that handles them","Add your dataset name to the elif chain or wrap it with name.lower() before calling"],"exampleFix":"# before\nds = get_dataset('FASHION-MNIST')  # ValueError\n\n# after\nds = get_dataset('fashion_mnist'.lower())  # normalize; use supported alias","handlingStrategy":"validation","validationCode":"SUPPORTED = {'cifar10','mnist','fashion_mnist','fashionmnist','stl10'}\nname = name.lower()\nassert name in SUPPORTED, f'{name} not in {SUPPORTED}'\nds = get_dataset(name, ...)","typeGuard":"def is_known_dataset(name: str) -> bool:\n    return name.lower() in {'cifar10','mnist','fashion_mnist','fashionmnist','stl10'}","tryCatchPattern":"try:\n    ds = get_dataset(name, root=root, train=train)\nexcept ValueError as e:\n    if 'Unknown dataset' in str(e):\n        raise SystemExit(f'Fix dataset name: {name}. Supported: ...') from e\n    raise","preventionTips":["Normalize names to lowercase with underscores early","Keep a single source-of-truth constant of supported names and validate config against it","Fail fast on config load, not deep in training"],"tags":["dataset","factory","invalid-argument","neuralforge"],"backgroundTag":"unknown-dataset-name","analyzedSha":"40f4cd2652d75ef8e49d76e5c4d431d458712719","analyzedAt":"2026-08-27T11:12:20.313Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}