Skip to content

InputSizeError

Bases: Exception

Raised when the amount of features being passed to a model does not match with its input size.

Source code in src/safeds/exceptions/_ml.py
class InputSizeError(Exception):
    """Raised when the amount of features being passed to a model does not match with its input size."""

    def __init__(self, data_size: int | ModelImageSize, input_layer_size: int | ModelImageSize | None) -> None:
        # TODO: remove input_layer_size type None again
        super().__init__(
            f"The data size being passed to the network({data_size}) does not match with its input size({input_layer_size}). Consider changing the data size of the model or reformatting the data.",
        )