View source on GitHub |
Triggers policy_saver
save calls in a separate thread asynchronously.
tf_agents.policies.async_policy_saver.AsyncPolicySaver(
policy_saver: tf_agents.policies.PolicySaver
)
Args | |
---|---|
policy_saver
|
An instance of a policy_saver.PolicySaver .
|
Methods
close
close()
Blocks until there is no saving happening and kills the save_thread.
flush
flush()
Blocks until there is no saving happening.
save
save(
export_dir: Text, blocking: bool = False
)
Triggers an async save of the policy to the given export_dir
.
Only one save can be triggered at a time. If save
or save_checkpoint
are called while another save of either kind is still ongoing the saving is
skipped.
If blocking is set then the call will block until any ongoing saves finish, and then a new save will be made before returning.
Args | |
---|---|
export_dir
|
Directory path for the saved_model of the policy.
|
blocking
|
If True the call to save will block until a save can be performed and finished. If a save was ongoing it will wait for that to finish, and then do a blocking save before returning. |
save_checkpoint
save_checkpoint(
export_dir: Text, blocking: bool = False
)
Triggers an async save of the policy checkpoint.
Only one save can be triggered at a time. If save
or save_checkpoint
are called while another save of either kind is still ongoing the saving is
skipped.
If blocking is set then the call will block until any ongoing saves finish, and then a new save will be made before returning.
Args | |
---|---|
export_dir
|
Directory path for the checkpoint of the policy. |
blocking
|
If True the call to save will block until a save can be performed and finished. If a save was ongoing it will wait for that to finish, and then do a blocking save before returning. |