首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何向Amazon Sagemaker输入fsx for lustre?

如何向Amazon Sagemaker输入fsx for lustre?
EN

Stack Overflow用户
提问于 2020-12-11 00:20:17
回答 1查看 297关注 0票数 2

我正在尝试设置Amazon sagemaker从我们的AWS Fsx for Lustre文件系统读取我们的数据集。

我们使用的是Sagemaker API,之前我们从s3读取数据集,这很好用:

代码语言:javascript
复制
estimator = TensorFlow(
   entry_point='model_script.py',  
   image_uri='719982911.dkr.ecr.eu-west-1.amazonaws.com/project_name/sagemaker-training-mlflow:latest', 
   instance_type='ml.m4.10xlarge',
   instance_count=1,
   role=role,
   framework_version='2.0.0',
   py_version='py3',
   subnets=["subnet-2375a679"],
   security_group_ids=["sg-6cb95013", "sg-0bc6ddb1f102bbdb1"],
   debugger_hook_config=False,
  )
estimator.fit({
    'training': f"s3://bucket_name/data/{hyperparameters['dataset']}/"}
)

但是现在我将输入数据源更改为Fsx文件系统,我得到了一个错误,文件输入应该是s3://或file://.我在关注这些docs (fsx lustre)

代码语言:javascript
复制
estimator = TensorFlow(
   entry_point='model_script.py',  
#    image_uri='71998291.dkr.ecr.eu-west-1.amazonaws.com/bucket_name/sagemaker-training-mlflow:latest', 
   instance_type='ml.m4.10xlarge',
   instance_count=1,
   role=role,
   framework_version='2.0.0',
   py_version='py3',
   subnets=["subnet-2375a679"],
   security_group_ids=["sg-6cb95013", "sg-0bc6ddb1f102bbdb1"],
   debugger_hook_config=False,
  )
fsx_data_folder = FileSystemInput(file_system_id='fs-03a0e6927e5ffc449',
                                    file_system_type='FSxLustre',
                                    directory_path='/fsx/data',
                                    file_system_access_mode='ro')
estimator.fit(f"{fsx_data_folder}/{hyperparameters['dataset']}/")

抛出以下错误:

代码语言:javascript
复制
ValueError: URI input <sagemaker.inputs.FileSystemInput object at 0x0000016A6C7F0788>/dataset_name/ must be a valid S3 or FILE URI: must start with "s3://" or "file://"

有人知道我做错了什么吗?提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2020-12-25 01:17:19

我(很愚蠢,为时已晚;)将FileSystemInput对象视为字符串,而不是对象。错误抱怨说,obj+string的串联不是指向s3中某个位置的有效URI。

正确的方法是在dataset的整个路径之外创建一个FileSystemInput对象。请注意,fit现在接受此对象,并将其挂载到data_dir = "/opt/ml/input/data/training"

代码语言:javascript
复制
fsx_data_obj = FileSystemInput(
    file_system_id='fs-03a0e6927e5ffc449',
    file_system_type='FSxLustre',
    directory_path='/fsx/data/{dataset}',
    file_system_access_mode='ro'
)
estimator.fit(fsx_data_obj)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65238339

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档