tensorflow - SageMaker TensorFlow Estimator 源码 S3 上传路径
问题描述
我正在使用 SageMaker TensorFlow 估计器进行训练,并使用参数为我的模型工件指定输出路径output_path
,其值为s3://<bucket>/<prefix>/
.
模型训练完成后,<training_job_name>/output
在指定的output_path
.
我遇到的问题是,用于训练的源代码也默认上传到 S3,但不是s3://<bucket>/<prefix>/<training_job_name>/source
放在s3://<bucket>/<training_job_name>/source
.
那么如何为训练作业的源代码指定 S3 上传路径,以使其使用存储桶和前缀名称output_path
?
解决方案
您是否尝试过使用“code_location”参数:https ://sagemaker.readthedocs.io/en/stable/estimators.html来指定源代码的位置?
下面是使用 code_location 的代码片段示例
from sagemaker.tensorflow import TensorFlow
code-path = "s3://<bucket>/<prefix>"
output-path = "s3://<bucket>/<prefix>"
abalone_estimator = TensorFlow(entry_point='abalone.py',
role=role,
framework_version='1.12.0',
training_steps= 100,
image_name=image,
evaluation_steps= 100,
hyperparameters={'learning_rate': 0.001},
train_instance_count=1,
train_instance_type='ml.c4.xlarge',
code_location= code-path,
output_path = output-path,
base_job_name='my-job-name'
)
推荐阅读
- java - java.lang.NoSuchMethodError: VarHandle.compareAndSet(VariableHandlesExample,State,State)void
- video-streaming - 是否可以即时进行 h264 编码并通过 websocket 网络发送视频?
- jquery - 使用 jQuery 验证自定义用户名和密码
- python - Spyder IDE 中 IDLE 和 IPython 控制台的不同输出。可能的原因
- angular - 在 Angular 中使用路由管理数据的问题
- laravel - 无法在 get 方法上序列化或反序列化 PDO 实例
- ruby-on-rails - StandardError:发生错误,所有后续迁移都取消:Rails migration error for remove Foreign keys
- php - Wordpress 如何为购买的主题添加自定义功能
- c# - 限制文本文件删除
- mysql - Xampp 打开 MariaDB 而不是 MySQL