server
server copied to clipboard
module 'triton' has no attribute 'language'
I'm getting the error message "AttributeError: module 'triton' has no attribute 'language'" when I update the triton library from version 2.47.0 to 2.48.0.
Hi @NguyenThanhHa288, can you share more details on how you're installing and what code you're writing that is generating this error?
Please provide the minimal steps to reproduce this error.
Same issue here with torch-2.4.0
File "/home/michael/.local/lib/python3.10/site-packages/torch/_dynamo/init.py", line 2, in
I got the same issue with @msoftware, this error comes from common_constant_types.add(triton.language.dtype),to reproduce this error, just execute from torchvision import transforms, my torchvision verison is 0.19.1
Hi, this looks like use of OpenAI Triton, and not NVIDIA Triton Inference Server. Please raise an issue here: https://github.com/triton-lang/triton
same error code is
triton_server_url = 'xxxxxxx:8003'
triton_client = InferenceServerClient(url=triton_server_url, verbose=False, ssl=False)
if triton_client.is_model_ready(model_name):
# Load the Triton Server model
model = YOLO(f"http://{triton_server_url}/yolov8x", task="detect")
# Run inference on the server
results = model.predict(r"E:\code\images\val\frame_027940.PNG")
for r in results:
print(f"Detected {len(r)} objects in image")
error is
Traceback (most recent call last):
File "E:\code\cards\api\test_triton.py", line 15, in <module>
results = model.predict(r"E:\code\cards\train\datasets\221319\images\val\frame_027940.PNG")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\miniconda\envs\card\Lib\site-packages\ultralytics\engine\model.py", line 554, in predict
return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\miniconda\envs\card\Lib\site-packages\ultralytics\engine\predictor.py", line 168, in __call__
return list(self.stream_inference(source, model, *args, **kwargs)) # merge list of Result into one
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\miniconda\envs\card\Lib\site-packages\torch\utils\_contextlib.py", line 36, in generator_context
response = gen.send(None)
^^^^^^^^^^^^^^
File "E:\miniconda\envs\card\Lib\site-packages\ultralytics\engine\predictor.py", line 234, in stream_inference
self.model.warmup(imgsz=(1 if self.model.pt or self.model.triton else self.dataset.bs, 3, *self.imgsz))
File "E:\miniconda\envs\card\Lib\site-packages\ultralytics\nn\autobackend.py", line 642, in warmup
import torchvision # noqa (import here so torchvision import time not recorded in postprocess time)
^^^^^^^^^^^^^^^^^^
File "E:\miniconda\envs\card\Lib\site-packages\torchvision\__init__.py", line 10, in <module>
from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils # usort:skip
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\miniconda\envs\card\Lib\site-packages\torchvision\models\__init__.py", line 2, in <module>
from .convnext import *
File "E:\miniconda\envs\card\Lib\site-packages\torchvision\models\convnext.py", line 8, in <module>
from ..ops.misc import Conv2dNormActivation, Permute
File "E:\miniconda\envs\card\Lib\site-packages\torchvision\ops\__init__.py", line 23, in <module>
from .poolers import MultiScaleRoIAlign
File "E:\miniconda\envs\card\Lib\site-packages\torchvision\ops\poolers.py", line 10, in <module>
from .roi_align import roi_align
File "E:\miniconda\envs\card\Lib\site-packages\torchvision\ops\roi_align.py", line 7, in <module>
from torch._dynamo.utils import is_compile_supported
File "E:\miniconda\envs\card\Lib\site-packages\torch\_dynamo\__init__.py", line 2, in <module>
from . import convert_frame, eval_frame, resume_execution
File "E:\miniconda\envs\card\Lib\site-packages\torch\_dynamo\convert_frame.py", line 48, in <module>
from . import config, exc, trace_rules
File "E:\miniconda\envs\card\Lib\site-packages\torch\_dynamo\exc.py", line 12, in <module>
from .utils import counters
File "E:\miniconda\envs\card\Lib\site-packages\torch\_dynamo\utils.py", line 1066, in <module>
common_constant_types.add(triton.language.dtype)
^^^^^^^^^^^^^^^
AttributeError: module 'triton' has no attribute 'language'
torch 2.4.1
torchvision 0.19.1
tqdm 4.66.5
tritonclient 2.51.0
server_version 2.50.0
so sorry ,in my project,there is a dir named triton, its a bad dirname,after refactor it ,is ok