ray.rllib.policy.policy.Policy.export_model#

Policy.export_model(export_dir: str, onnx: int | None = None) None[source]#

Exports the Policy’s Model to local directory for serving.

Note: The file format will depend on the deep learning framework used. See the child classed of Policy and their export_model implementations for more details.

Parameters:
  • export_dir – Local writable directory.

  • onnx – If given, will export model in ONNX format. The value of this parameter set the ONNX OpSet version to use.

Raises:

ValueError – If a native DL-framework based model (e.g. a keras Model) cannot be saved to disk for various reasons.