我想通过 image_uri 参数将 ECR 上的公共 Docker 映像传递给 Estimator。但是,训练作业找不到此图像。我正在使用 AWS SageMaker Notebook 实例运行我的代码。
from sagemaker.estimator import Estimator
byoc_image_uri = 'public.ecr.aws/v8x6t9d9/train-image-classifier-firefly'
estimator = Estimator(image_uri=byoc_image_uri,
role=role,
base_job_name='tf-custom-container-test-job',
instance_count=1,
hyperparameters=hyperparameters,
output_path=output_path,
instance_type='ml.p2.xlarge')
我试过的:
- 我首先尝试在 ECR privet 存储库中使用相同的图像。这有效
- 然后将相同的图像推送到我创建的公共 ECR 存储库。图像已成功推送,我可以成功拉出此图像。
- 但是,当我尝试通过 Estimator image_uri 参数使用相同的图像 url 时。我收到以下错误消息
ClientError: An error occurred (ValidationException) when calling the CreateTrainingJob operation: TrainingImageConfig with TrainingRepositoryAccessMode set to VPC must be provided when using a training image from a private Docker registry. Please provideTrainingImageConfig and TrainingRepositoryAccessMode set to VPC when using a training image from a private Docker registry.