mars.learn.contrib.tensorflow.run_tensorflow_script(script, n_workers, n_ps=0, gpu=None, command_argv=None, retry_when_fail=False, session=None, run_kwargs=None, port=None)[源代码]

Run TensorFlow script in Mars cluster.

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

  • n_workers – number of TensorFlow workers

  • n_ps – number of TensorFlow ps, optional

  • gpu – run TensorFlow script on GPU

  • command_argv – extra command args for script

  • retry_when_fail – bool, default False. If True, retry when function failed.

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

  • run_kwargs – extra kwargs for

  • port – port of TensorFlow worker or ps, will automatically increase for the same worker


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