Sagemaker 处理不上传
Sagemaker Processing doesn't upload
我正在尝试使用 sagemaker 处理器来替换我们 运行 在 Amazon 批处理上的一些流程。
from sagemaker.processor import ScriptProcessor
proc = ScriptProcessor(
image_uri='your-image-uri',
command=['python3'],
role=role,
instance_count=1,
instance_type='m4.4x.large',
volume_size_in_gb=500,
base_job_name='preprocessing-test',
)
proc.run(
code='test.py',
)
首先,ScriptProcessing
语法是不是比TrainingJob
版本更复杂,你可以指定source_dir
和entrypoint
来上传你的代码到默认容器?
其次,上面的这段代码给了我这个错误
ParamValidationError: Parameter validation failed:
Invalid bucket name "sagemaker-eu-west-1-<account-id>\preprocessing-test-<timestamp>\input\code": Bucket name must match the regex "^[a-zA-Z0-9.\-_]{1,255}$" or be an ARN matching the regex "^arn:(aws).*:s3:[a-z\-0-9]+:[0-9]{12}:accesspoint[/:][a-zA-Z0-9\-]{1,63}$"
我想这个密钥是在尝试上传我的 test.py
时在内部创建的,但为什么它不起作用? :) 文档说您可以同时使用本地和 s3 路径。
存储桶名称 `sagemaker-eu-west-1-\preprocessing-test-\input\code 看起来像一个硬编码字符串。在SageMaker Python SDK中,代码上传函数为here:
您使用的是 Windows 环境吗?正如劳伦在评论中指出的那样,那里修复了一些错误,因此请确保使用最新版本
我正在尝试使用 sagemaker 处理器来替换我们 运行 在 Amazon 批处理上的一些流程。
from sagemaker.processor import ScriptProcessor
proc = ScriptProcessor(
image_uri='your-image-uri',
command=['python3'],
role=role,
instance_count=1,
instance_type='m4.4x.large',
volume_size_in_gb=500,
base_job_name='preprocessing-test',
)
proc.run(
code='test.py',
)
首先,ScriptProcessing
语法是不是比TrainingJob
版本更复杂,你可以指定source_dir
和entrypoint
来上传你的代码到默认容器?
其次,上面的这段代码给了我这个错误
ParamValidationError: Parameter validation failed:
Invalid bucket name "sagemaker-eu-west-1-<account-id>\preprocessing-test-<timestamp>\input\code": Bucket name must match the regex "^[a-zA-Z0-9.\-_]{1,255}$" or be an ARN matching the regex "^arn:(aws).*:s3:[a-z\-0-9]+:[0-9]{12}:accesspoint[/:][a-zA-Z0-9\-]{1,63}$"
我想这个密钥是在尝试上传我的 test.py
时在内部创建的,但为什么它不起作用? :) 文档说您可以同时使用本地和 s3 路径。
存储桶名称 `sagemaker-eu-west-1-\preprocessing-test-\input\code 看起来像一个硬编码字符串。在SageMaker Python SDK中,代码上传函数为here:
您使用的是 Windows 环境吗?正如劳伦在评论中指出的那样,那里修复了一些错误,因此请确保使用最新版本