{"record":{"id":"e5c68b68538c1831","repo":"tensorflow/models","slug":"invalid-model-received-received-supported-mo","errorCode":null,"errorMessage":"Invalid model received. Received: {}. Supported models for{} include: {}","messagePattern":"Invalid model received\\. Received: (.+?)\\. Supported models for(.+?) include: (.+?)","errorType":"exception","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"official/legacy/image_classification/configs/configs.py","lineNumber":188,"sourceCode":"\n\ndef get_config(model: str, dataset: str) -> base_configs.ExperimentConfig:\n  \"\"\"Given model and dataset names, return the ExperimentConfig.\"\"\"\n  dataset_model_config_map = {\n      'imagenet': {\n          'efficientnet': EfficientNetImageNetConfig(),\n          'resnet': ResNetImagenetConfig(),\n          'vgg': VGGImagenetConfig(),\n      }\n  }\n  try:\n    return dataset_model_config_map[dataset][model]\n  except KeyError:\n    if dataset not in dataset_model_config_map:\n      raise KeyError('Invalid dataset received. Received: {}. Supported '\n                     'datasets include: {}'.format(\n                         dataset, ', '.join(dataset_model_config_map.keys())))\n    raise KeyError('Invalid model received. Received: {}. Supported models for'\n                   '{} include: {}'.format(\n                       model, dataset,\n                       ', '.join(dataset_model_config_map[dataset].keys())))\n","sourceCodeStart":170,"sourceCodeEnd":192,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/image_classification/configs/configs.py#L170-L192","documentation":"Lookup guard in get_config: the dataset is known (e.g. 'imagenet') but the model name has no entry under that dataset — for imagenet only efficientnet, resnet, and vgg are registered. The model string is the faulty input.","triggerScenarios":"Thrown at official/legacy/image_classification/configs/configs.py:188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a model registered for the dataset: 'efficientnet', 'resnet', or 'vgg' for imagenet","Add the model's config class to dataset_model_config_map"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}