Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: can't convert np.ndarray of type numpy.object. #4930

Open
payamahmadvand-stemcell opened this issue Nov 16, 2024 · 0 comments
Open
Labels

Comments

@payamahmadvand-stemcell

I am making an endpoint with this images on AWS sagemaker
763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-inference:2.5.1-gpu-py311-cu124-ubuntu22.04-sagemaker
I am trying to use SAM2 model by Meta
the numpy version seems to be correct :
Requirement already satisfied: numpy>=1.24.4 in /opt/conda/lib/python3.11/site-packages

When I try to predict I am getting this error:

2024-11-14T22:56:39,132 [INFO ] W-9000-model_1.0-stdout MODEL_LOG - Transform failed for model: model. Error traceback: ['Traceback (most recent call last):', ' File "/opt/conda/lib/python3.11/site-packages/sagemaker_inference/transformer.py", line 150, in transform', ' result = self._run_handler_function(', ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^', ' File "/opt/conda/lib/python3.11/site-packages/sagemaker_inference/transformer.py", line 284, in _run_handler_function', ' result = func(*argv_context)', ' ^^^^^^^^^^^^^^^^^^^', ' File "/opt/conda/lib/python3.11/site-packages/sagemaker_inference/transformer.py", line 267, in _default_transform_fn', ' data = self._run_handler_function(self._input_fn, *(input_data, content_type))', ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^', ' File "/opt/conda/lib/python3.11/site-packages/sagemaker_inference/transformer.py", line 280, in run_handler_function', ' result = func(*argv)', ' ^^^^^^^^^^^', ' File "/opt/conda/lib/python3.11/site-packages/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py", line 98, in default_input_fn', ' tensor = torch.FloatTensor(', ' ^^^^^^^^^^^^^^^^^^', "TypeError: can't convert np.ndarray of type numpy.object. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint64, uint32, uint16, uint8, and bool."]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant