mars.learn.contrib.tensorflow.run_tensorflow_script(script: Union[bytes, str, BinaryIO, TextIO], n_workers: int, n_ps: int = 0, data: Optional[Dict[str, TileableType]] = None, gpu: Optional[bool] = None, command_argv: Optional[List[str]] = None, retry_when_fail: bool = False, session: Optional[SessionType] = None, run_kwargs: Optional[Dict[str, Any]] = None)[source]#

Run TensorFlow script in Mars cluster.

  • script (str or file-like object) – Script to run

  • n_workers (int) – Number of TensorFlow workers.

  • n_ps (int) – Number of TensorFlow PS workers.

  • data (dict) – Variable name to data.

  • gpu (bool) – Run PyTorch script on GPU

  • command_argv (list) – Extra command args for script

  • retry_when_fail (bool) – If True, retry when function failed.

  • session – Mars session, if not provided, will use default one.

  • run_kwargs (dict) – Extra kwargs for


return {‘status’: ‘ok’} if succeeded, or error raised

Return type