如何在Python Sagemaker SDK中使用TensorFlow估计器指定最大运行时间?

如何在Python Sagemaker SDK中使用TensorFlow估计器指定最大运行时间?,python,tensorflow,amazon-sagemaker,Python,Tensorflow,Amazon Sagemaker,使用Python Sagemaker SDK,可以使用TensorFlow启动培训作业,代码如下: import sagemaker from sagemaker.tensorflow import TensorFlow sess = sagemaker.Session() tf_estimator = TensorFlow(...) tf_estimator.fit(...) 是否可以在此脚本中指定培训的最大运行时间?在AWS支持下找到了答案: TensorFlow估计器有一个基类sage

使用Python Sagemaker SDK,可以使用TensorFlow启动培训作业,代码如下:

import sagemaker
from sagemaker.tensorflow import TensorFlow

sess = sagemaker.Session()
tf_estimator = TensorFlow(...)
tf_estimator.fit(...)

是否可以在此脚本中指定培训的最大运行时间?

在AWS支持下找到了答案:

TensorFlow估计器有一个基类sagemaker.estimator.Framework,该基类又有一个基类sagemaker.estimator.estimator,该基类接受参数train_max_run,该参数接受以秒为单位的值,默认为86400或24小时

因此,TensorFlow估计器的初始化将传递最大训练运行时间的自定义值,如下所示:

MAX_TRAINING_TIME = 99999
tf_estimator = TensorFlow(..., train_max_run=MAX_TRAINING_TIME)

由于AWS支持,找到了答案:

TensorFlow估计器有一个基类sagemaker.estimator.Framework,该基类又有一个基类sagemaker.estimator.estimator,该基类接受参数train_max_run,该参数接受以秒为单位的值,默认为86400或24小时

因此,TensorFlow估计器的初始化将传递最大训练运行时间的自定义值,如下所示:

MAX_TRAINING_TIME = 99999
tf_estimator = TensorFlow(..., train_max_run=MAX_TRAINING_TIME)

让我对@Franco的答案加上一点更正


sagemaker.estimator.EstimaterBase的参数名为max_run=86400,用于分配最大运行时间。

让我对@Franco的答案进行一点修正

sagemaker.estimator.EstimaterBase的参数名为max_run=86400,用于分配最大运行时间