aws / aws/sagemaker-python-sdk

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

已关闭
#4,930 0 条评论 0 个 reaction 已指派 1 人 已被 @erickb336 认领 在 GitHub 查看
component: Inference APIs and Interfaces type: bug
主要语言
Python
星标
2.3k
派生
1.3k
平均合并
1 天 22 小时
30 天内合并 PR
35

描述

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."]

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。