ray.train.tensorflow.TensorflowPredictor.from_checkpoint#

classmethod TensorflowPredictor.from_checkpoint(checkpoint: ray.air.checkpoint.Checkpoint, model_definition: Optional[Union[Callable[[], keras.engine.training.Model], Type[keras.engine.training.Model]]] = None, use_gpu: Optional[bool] = False) ray.train.tensorflow.tensorflow_predictor.TensorflowPredictor[source]#

Instantiate the predictor from a Checkpoint.

The checkpoint is expected to be a result of TensorflowTrainer.

Parameters
  • checkpoint – The checkpoint to load the model and preprocessor from. It is expected to be from the result of a TensorflowTrainer run.

  • model_definition – A callable that returns a TensorFlow Keras model to use. Model weights will be loaded from the checkpoint. This is only needed if the checkpoint was created from TensorflowCheckpoint.from_model.

  • use_gpu – Whether GPU should be used during prediction.