Can not pull public ECR image using AWS SageMaker Estimator

740 Views Asked by At

I would like to pass a public Docker Image on ECR through the image_uri parameter to the Estimator. However, the training job fails to find this image. I'm running my code using AWS SageMaker Notebook instance.

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')

What I have tried:

  • I first tried to use the same image on an ECR privet repo. This works
  • Then pushed the same image to a public ECR repo that I had created. The image was successfully pushed and I could pull this image successfully.
  • However, when I tried to use the same image url through Estimator image_uri parameter. I get the following error message
    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.
0

There are 0 best solutions below