Ejemplo n.º 1
0
            public override async Task <Context> Execute(Context context)
            {
                var result = await sageMaker.CreateModelAsync(new CreateModelRequest
                {
                    ExecutionRoleArn = context.TrainingRoleArn,
                    ModelName        = context.TrainingJobName,
                    PrimaryContainer = new ContainerDefinition
                    {
                        Image        = context.TrainingImage,
                        ModelDataUrl =
                            $"https://s3-{context.Region}.amazonaws.com/{context.TrainingBucketName}/SageMaker/model/{context.TrainingJobName}/output/model.tar.gz"
                    }
                });

                context.ModelArn = result.ModelArn;
                return(context);
            }
Ejemplo n.º 2
0
 private Amazon.SageMaker.Model.CreateModelResponse CallAWSServiceOperation(IAmazonSageMaker client, Amazon.SageMaker.Model.CreateModelRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Service", "CreateModel");
     try
     {
         #if DESKTOP
         return(client.CreateModel(request));
         #elif CORECLR
         return(client.CreateModelAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }