我正在尝试设置Amazon sagemaker从我们的AWS Fsx for Lustre文件系统读取我们的数据集。
我们使用的是Sagemaker API,之前我们从s3读取数据集,这很好用:
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)
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']}/")抛出以下错误:
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://"有人知道我做错了什么吗?提前感谢!
发布于 2020-12-25 01:17:19
我(很愚蠢,为时已晚;)将FileSystemInput对象视为字符串,而不是对象。错误抱怨说,obj+string的串联不是指向s3中某个位置的有效URI。
正确的方法是在dataset的整个路径之外创建一个FileSystemInput对象。请注意,fit现在接受此对象,并将其挂载到data_dir = "/opt/ml/input/data/training"。
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)https://stackoverflow.com/questions/65238339
复制相似问题