<!-- # hard line break macro for HTML -->

# fiftyone.core.annotation.validate_label_schemas

Annotation label schema validation

Copyright 2017-2026, Voxel51, Inc.
<br/>
[voxel51.com](https://voxel51.com/)
<br/>
<br/>

**Exceptions:**

| [`ValidationErrors`](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors)   | Validation errors for label schemas   |
|-------------------------------------------------------------------------------------------|---------------------------------------|

**Functions:**

| [`validate_label_schemas`](#fiftyone.core.annotation.validate_label_schemas.validate_label_schemas)(sample_collection, ...)   | Validates label schemas for a [`fiftyone.core.collections.SampleCollection`](fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection).   |
|-------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|

### *exception* fiftyone.core.annotation.validate_label_schemas.ValidationErrors

Bases: `ExceptionGroup`

Validation errors for label schemas

**Methods:**

| [`add_note`](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors.add_note)(object, /)             | Exception.add_note(note) -- add a note to the exception                         |
|-----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| [`derive`](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors.derive)(object, /)                 |                                                                                 |
| [`split`](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors.split)(object, /)                   |                                                                                 |
| [`subgroup`](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors.subgroup)(object, /)             |                                                                                 |
| [`with_traceback`](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors.with_traceback)(object, /) | Exception.with_traceback(tb) -- set self._\_traceback_\_ to tb and return self. |

**Attributes:**

| [`args`](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors.args)             |                   |
|----------------------------------------------------------------------------------------------|-------------------|
| [`exceptions`](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors.exceptions) | nested exceptions |
| [`message`](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors.message)       | exception message |

#### add_note(object,)

Exception.add_note(note) –
add a note to the exception

#### args

#### derive(object,)

#### exceptions

nested exceptions

#### message

exception message

#### split(object,)

#### subgroup(object,)

#### with_traceback(object,)

Exception.with_traceback(tb) –
set self._\_traceback_\_ to tb and return self.

### fiftyone.core.annotation.validate_label_schemas.validate_label_schemas(sample_collection, label_schema, allow_new_attrs=False, allow_new_fields=False, fields=None, \_allow_default=False)

Validates label schemas for a
[`fiftyone.core.collections.SampleCollection`](fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection).  See
`generate_label_schemas()` for acceptable label schema specifications

* **Parameters:**
  * **sample_collection** – the
    [`fiftyone.core.collections.SampleCollection`](fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection)
  * **label_schema** – a label schemas `dict` or an individual field’s label
    schema `dict` if only one field is provided
  * **allow_new_attrs** (*False*) – whether to allow label attributes that do not
    yet exist on the [field schema](../user_guide/using_datasets.md#field-schemas)
  * **allow_new_fields** (*False*) – whether to allow label schemas for fields
    that do not yet exist on the [field schema](../user_guide/using_datasets.md#field-schemas)
  * **fields** (*None*) – a field name, `embedded.field.name` or iterable of
    such values
* **Raises:**
  [**ValidationErrors**](#fiftyone.core.annotation.validate_label_schemas.ValidationErrors) – if the label schema(s) are invalid
