title: Amazon SageMaker Unsupported content-type application/x-image
body: <p>I have a tensorflow/keras based CNN model deployed in Sagemaker.</p>
  
  <p>Now to invoke the inference, I followed this <a href="https://aws.amazon.com/blogs/machine-learning/classify-your-own-images-using-amazon-sagemaker/" rel="nofollow noreferrer">tutorial</a></p>
  
  <p>Below code snippet</p>
  
  <pre><code>def inferImage(endpoint_name):
      # Load the image bytes
      img = open('./shoe.jpg', 'rb').read()
      runtime = boto3.Session().client(service_name='sagemaker-runtime')
  
      # Call your model for predicting which object appears in this image.
      response = runtime.invoke_endpoint(
          EndpointName=endpoint_name,
          ContentType='application/x-image',
          Body=bytearray(img))
      response_body = response['Body']
      print(response_body.read()) 
  </code></pre>
  
  <p>When I run this code, I get error</p>
  
  <p><code>Unsupported content-type application/x-image</code></p>
  
  <p>What am I missing? Any suggestion on how to fix it?</p>