amazon-sagemaker

Invalid syntax when using the cursor.execute in python ( sagemaker notebook)

Invalid syntax when using the cursor.execute in python ( sagemaker notebook) Question: select * FROM HEVOPROD_DB.HEVOPROD_SCH.PRDNEW_METERING where REQUESTED_SERVICE = ‘["dsp"]’ and longitude is not null ; The above query works fine when i query this in snowflake while using this query in sagemaker notebook/ jupyter notebook it just fails stating invalid syntax important point here …

Total answers: 1

Deploy a custom pipeline using Sagemaker SDK

Deploy a custom pipeline using Sagemaker SDK Question: I have been having a hard time to deploy my locally trained SKlearn model (pipeline with custom code + logistic model) to Sagemaker Endpoint. My Pipeline is as follows: All this custom code (RecodeCategorias) does is normalize and recode some categories columns into a "other" value, for …

Total answers: 2

Sagemaker HyperparameterTuner and fixed hyper parameters (StaticHyperParameters)

Sagemaker HyperparameterTuner and fixed hyper parameters (StaticHyperParameters) Question: I used to use this type of hyper parameter (optimisation) specification: "OutputDataConfig": {"S3OutputPath": output_path}, "ResourceConfig": {"InstanceCount": 1, "InstanceType": "ml.m4.xlarge", "VolumeSizeInGB": 3}, "RoleArn": role_arn, "StaticHyperParameters": { "objective": "reg:squarederror" }, "StoppingCondition": {"MaxRuntimeInSeconds": 10000} TBH I do not even know if this is an old way of doing things or …

Total answers: 1

Is there a way to speed up the Save method with PIL?

Is there a way to speed up the Save method with PIL? Question: I have an API that saves an the image to S3 bucket and returns the S3 URL but the saving part of the PIL image is slow. Here is a snippet of code: from PIL import Image import io import boto3 BUCKET …

Total answers: 1

How to use all GPUs in SageMaker real-time inference?

How to use all GPUs in SageMaker real-time inference? Question: I have deployed a model on real-time inference in a single gpu instance, it works fine. Now I want to use a multiple GPUs to decrease the inference time, what do I need to change in my inference.py to make it work? Here is some …

Total answers: 2

How to use coda as device on a gpu instance when deploying an endpoint?

How to use coda as device on a gpu instance when deploying an endpoint? Question: I have the following code to deploy my model: model = PyTorchModel( entry_point=’inference.py’, source_dir=’code’, role=role, model_data=model_data, framework_version="1.12.0", py_version=’py38′, code_location=’s3://staging’, name=’Staging-Model’ ) instance_type = ‘ml.g4dn.xlarge’ predictor = model.deploy( initial_instance_count=1, instance_type=instance_type, serializer=JSONSerializer(), deserializer=JSONDeserializer(), ) In my inference code I have: DEVICE = …

Total answers: 1

botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden while using local mode in AWS SageMaker

botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden while using local mode in AWS SageMaker Question: trainer = PyTorch( entry_point="train.py", source_dir= "source_dir", # directory of your training script role=role, framework_version="1.5.0", py_version="py3", instance_type= "local", instance_count=1, output_path=output_path, hyperparameters = hyperparameters ) This code is running SageMaker NoteNook instance. Error Creating dsd3faq5lq-algo-1-ouews … Creating dsd3faq5lq-algo-1-ouews …

Total answers: 2

AWS SageMaker Jupyter Notebook: Images not Showing

AWS SageMaker Jupyter Notebook: Images not Showing Question: I’m currently trying to display some images using AWS SageMaker making use of its Jupyter Notebook app. However, all I’m trying to do is show the loaded images. I have written a function to do this but all I’m left with is the images index and image …

Total answers: 1

How to integrate two models in sequential order in one endpoint?

How to integrate two models in sequential order in one endpoint? Question: I want to create an API using one endpoint but in my app, the first model output is the second model output. Is it possible to implement using SageMaker? From my understanding model_fn, prediction_fn, output_fn can only use one model at a time. …

Total answers: 1

Save images from sagemaker training

Save images from sagemaker training Question: I am trying to save images that I configure during training to the output bucket in sagemaker. I’ve read that all the information that needs to be saved during training goes into the model.tar.gz file. I’ve tried saving plots using the model_dir and the output_data_dir to no avail. The …

Total answers: 1