aws-samples / amazon-sagemaker-tensorflow-object-detection-api

Train and deploy models using TensorFlow 2 with the Object Detection API on Amazon SageMaker
MIT No Attribution
44 stars 34 forks source link

Error when inferring with a deployed model #15

Closed bonzoq closed 3 years ago

bonzoq commented 3 years ago

I trained and inferred with the provided bees dataset no problem.

I now have trained a model with my own dataset and get an error when inferring.

detections = predictor.predict(input)['predictions'][0] causes the following error:

`

ClientError Traceback (most recent call last)

in 12 } 13 ---> 14 detections = predictor.predict(input)['predictions'][0] 15 16 img_with_detections = img.copy() ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/tensorflow/model.py in predict(self, data, initial_args) 104 args["CustomAttributes"] = self._model_attributes 105 --> 106 return super(TensorFlowPredictor, self).predict(data, args) 107 108 ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/sagemaker/predictor.py in predict(self, data, initial_args, target_model, target_variant, inference_id) 134 data, initial_args, target_model, target_variant, inference_id 135 ) --> 136 response = self.sagemaker_session.sagemaker_runtime_client.invoke_endpoint(**request_args) 137 return self._handle_response(response) 138 ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs) 384 "%s() only accepts keyword arguments." % py_operation_name) 385 # The "self" in this scope is referring to the BaseClient. --> 386 return self._make_api_call(operation_name, kwargs) 387 388 _api_call.__name__ = str(py_operation_name) ~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params) 703 error_code = parsed_response.get("Error", {}).get("Code") 704 error_class = self.exceptions.from_code(error_code) --> 705 raise error_class(parsed_response, operation_name) 706 else: 707 return parsed_response ClientError: An error occurred (413) when calling the InvokeEndpoint operation: ` What can be wrong here?
bonzoq commented 3 years ago

The dimensions of the image I run the network on were too large.