ยป Keras API reference / KerasTuner / Errors

Errors

[source]

FailedTrialError class

keras_tuner.errors.FailedTrialError()

Raise this error to mark a Trial as invalid.

When this error is raised, the Tuner would not retry the Trial but directly mark it as "INVALID".

Example

class MyHyperModel(keras_tuner.HyperModel):
    def build(self, hp):
        # Build the model
        ...
        if too_slow(model):
            # Mark the Trial as "INVALID" if the model is too slow.
            raise keras_tuner.FailedTrialError("Model is too slow.")
        return model

[source]

FatalError class

keras_tuner.errors.FatalError()

Error specially to breakthrough try-except for Tuner.run_trial().

This error will raised again after caught by the try-except around Tuner.run_trial(). So, it should only be used in subroutines of Tuner.run_trial().

It is used to terminate the KerasTuner program for errors that need users immediate attention.


[source]

FatalValueError class

keras_tuner.errors.FatalValueError()

Error specially to breakthrough try-except for Tuner.run_trial().

This error will raised again after caught by the try-except around Tuner.run_trial(). So, it should only be used in subroutines of Tuner.run_trial().

It is used to terminate the KerasTuner program for errors that need users immediate attention.


[source]

FatalTypeError class

keras_tuner.errors.FatalTypeError()

Error specially to breakthrough try-except for Tuner.run_trial().

This error will raised again after caught by the try-except around Tuner.run_trial(). So, it should only be used in subroutines of Tuner.run_trial().

It is used to terminate the KerasTuner program for errors that need users immediate attention.


[source]

FatalRuntimeError class

keras_tuner.errors.FatalRuntimeError()

Error specially to breakthrough try-except for Tuner.run_trial().

This error will raised again after caught by the try-except around Tuner.run_trial(). So, it should only be used in subroutines of Tuner.run_trial().

It is used to terminate the KerasTuner program for errors that need users immediate attention.