def check_training_model(model):
    """ Check that model is a training model and exit otherwise.
    """
    try:
        assert_training_model(model)
    except AssertionError as e:
        print(e, file=sys.stderr)
        sys.exit(1)
 Check that model is a training model and exit otherwise.
    
keras_retinanet/models/__init__.py