FailedTrialError
classkeras_tuner.errors.FailedTrialError()
Raise this error to mark a Trial
as failed.
When this error is raised in a Trial
, the Tuner
would not retry the
Trial
but directly mark it as "FAILED"
.
Example
class MyHyperModel(keras_tuner.HyperModel):
def build(self, hp):
# Build the model
...
if too_slow(model):
# Mark the Trial as "FAILED" if the model is too slow.
raise keras_tuner.FailedTrialError("Model is too slow.")
return model
FatalError
classkeras_tuner.errors.FatalError()
A fatal error during search to terminate the program.
It is used to terminate the KerasTuner program for errors that need
users immediate attention. When this error is raised in a Trial
, it will
not be caught by KerasTuner.
FatalValueError
classkeras_tuner.errors.FatalValueError()
A fatal error during search to terminate the program.
It is a subclass of FatalError
and ValueError
.
It is used to terminate the KerasTuner program for errors that need
users immediate attention. When this error is raised in a Trial
, it will
not be caught by KerasTuner.
FatalTypeError
classkeras_tuner.errors.FatalTypeError()
A fatal error during search to terminate the program.
It is a subclass of FatalError
and TypeError
.
It is used to terminate the KerasTuner program for errors that need
users immediate attention. When this error is raised in a Trial
, it will
not be caught by KerasTuner.
FatalRuntimeError
classkeras_tuner.errors.FatalRuntimeError()
A fatal error during search to terminate the program.
It is a subclass of FatalError
and RuntimeError
.
It is used to terminate the KerasTuner program for errors that need
users immediate attention. When this error is raised in a Trial
, it will
not be caught by KerasTuner.