TensorBoard#

class pai.tensorboard.TensorBoard(tensorboard_id: str, session: Optional[Session] = None)#

基类:object

property app_uri#

Get the TensorBoard application URI.

classmethod create(uri: str, wait: bool = True, display_name: Optional[str] = None, max_runtime_in_minutes: Optional[int] = None, source_id: Optional[str] = None, source_type: Optional[str] = None, session: Optional[Session] = None) TensorBoard#

Launch a TensorBoard Application.

参数:
  • uri (str) -- A OSS URI to the directory containing the TensorBoard logs.

  • wait (bool) -- Whether to wait for the TensorBoard application to be ready.

  • display_name (str, optional) -- Display name of the TensorBoard application. Defaults to None.

  • max_runtime_in_minutes -- Maximum running time in minutes.

  • source_type (str, optional) -- The type of the source object. Defaults to None.

  • source_id (str, optional) -- The ID of the source object. Defaults to None.

  • session -- A Session object to use in interacting with PAI.

返回:

A TensorBoard object.

返回类型:

TensorBoard

示例

Create a TensorBoard application from a OSS URI: >>> from pai.tensorboard import TensorBoard >>> tb = TensorBoard.create("oss://my-bucket/path/to/logs_dir/") >>> # Get TensorBoard Application URL. >>> print(tb.app_uri)

wait()#

Wait for the TensorBoard application to be ready.

抛出:

UnExpectedStatusException -- If the TensorBoard application is terminated unexpectedly.

start(wait: bool = True)#

Start the TensorBoard application.

stop()#

Stop the TensorBoard application.

delete()#

Delete the TensorBoard Application.