Thank you Philipp, I haven’t found that notebook before. I can run the example for the Segformer in there without a problem, also for serverless.
But if I try to adapt this for YOLOS (serverless or not does not matter), I do get the above error.
Here is the code I’m trying for the YOLOS serverless endpoint:
hub = {
'HF_MODEL_ID':'hustvl/yolos-tiny',
'HF_TASK':'object-detection'
}
# create Hugging Face Model Class
huggingface_model = HuggingFaceModel(
sagemaker_session=sess,
env=hub, # configuration for loading model from Hub
role=role, # iam role with permissions to create an Endpoint
transformers_version="4.17", # transformers version used
pytorch_version="1.10", # pytorch version used
py_version='py38', # python version used
)
# Specify MemorySizeInMB and MaxConcurrency in the serverless config object
serverless_config = ServerlessInferenceConfig(
memory_size_in_mb=4096, max_concurrency=10,
)
# deploy the endpoint
yolos_predictor = huggingface_model.deploy(
endpoint_name="yolos-object-detection-serverless",
serverless_inference_config=serverless_config,
serializer=image_serializer
)
yolos_predictor.predict(data="example_resized.jpg")
I see, thank you @philschmid .
I’ll try that and if it takes to much time I’ll try DETR, as I think that should already be included in transformers 4.17.0 and should be good enough for my needs