ray.train.tensorflow.TensorflowPredictor.from_checkpoint
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
TensorflowTrainerrun.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
checkpointwas created fromTensorflowCheckpoint.from_model.use_gpu – Whether GPU should be used during prediction.