server icon indicating copy to clipboard operation
server copied to clipboard

Python backend cannot import Tensor

Open Phelan164 opened this issue 2 years ago • 6 comments

Description Python backend model import Tensor from triton_python_backend_utils import Tensor Got error: UNAVAILABLE: Internal: ImportError: cannot import name 'Tensor' from 'triton_python_backend_utils' (/opt/tritonserver/backends/python/triton_python_backend_utils.py Triton inference server version 22.05 still work well

If import from c_python_backend_utils it work

Triton Information Triton inference server version 22.07

To Reproduce Steps to reproduce the behavior.

Describe the models (framework, inputs, outputs), ideally include the model configuration file (if using an ensemble include the model configuration file for that as well).

Expected behavior A clear and concise description of what you expected to happen.

Phelan164 avatar Sep 12 '22 16:09 Phelan164

Hi @Tabrizian, do you know if from triton_python_backend_utils import Tensor import is supported in the Python backend?

kthui avatar Sep 12 '22 21:09 kthui

@kthui @Tabrizian any update for this issue

Phelan164 avatar Sep 20 '22 16:09 Phelan164

@Phelan164 Sorry for delay in responding to this thread. Importing Tensor from triton_python_backend_utils is not supported before initialize function is called. We can fix this issue in Python models. I'll file a ticket for the same.

Tabrizian avatar Oct 14 '22 20:10 Tabrizian

@Tabrizian thanks for your information.

Phelan164 avatar Oct 25 '22 03:10 Phelan164

Hi is this issue fixed, I still cannot run from triton_python_backend_utils import Tensor in nvcr.io/nvidia/tritonserver:22.12-py3?

SamSamhuns avatar Jan 29 '23 10:01 SamSamhuns

Related issue: https://github.com/triton-inference-server/server/issues/6535

Ref: 4234

dyastremsky avatar Feb 20 '24 18:02 dyastremsky