I get trt output with trtexec, but when I try to run this output in v8, I get the error “unicodedecodeerror: ‘utf-8’ codec can’t decode byte 0xe8 in position 4: invalid continuation byte”?
note:
When I convert as yolo…mode=engine, trt happens, but the performance increase I want is not achieved.
Can anyone help with these issues?
Hi,
The error is related to encoding/decoding.
Could you share the API/command that causes this error?
Thanks.
/usr/src/tensorrt/bin/trtexec --onnx=v8.onnx --saveEngine=v8.engine
ım converting onnx to engine file with this code. Then when ı try the engine file in my code , ım getting the this error.
Hi,
It seems that you meet the same issue as below.
Please try the workaround mentioned in that topic:
opened 05:47PM - 01 Mar 23 UTC
question
non-reproducible
Stale
### Search before asking
- [X] I have searched the YOLOv8 [issues](https://gith… ub.com/ultralytics/ultralytics/issues) and [discussions](https://github.com/ultralytics/ultralytics/discussions) and found no similar questions.
### Question
Hi! I am trying to use a yolov8 model converted using tensorrt. When I do the following command:
```
from ultralytics import YOLO
results= YOLO('./yolov8s.engine').predict(device=0)
```
I get the following error:
```
Ultralytics YOLOv8.0.44 🚀 Python-3.8.10 torch-2.0.0a0+ec3941ad.nv23.02 CUDA:0 (Orin, 30589MiB)
Loading yolov8s.engine for TensorRT inference...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/ultralytics/ultralytics/yolo/engine/model.py", line 201, in predict
self.predictor.setup_model(model=self.model)
File "/root/ultralytics/ultralytics/yolo/engine/predictor.py", line 221, in setup_model
self.model = AutoBackend(model, device=device, dnn=self.args.dnn, data=self.args.data, fp16=self.args.half)
File "/root/ultralytics/ultralytics/nn/autobackend.py", line 151, in __init__
meta = json.loads(f.read(meta_len).decode('utf-8')) # read metadata
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 4: invalid continuation byte
```
Can someone help me here?
Thanks a lot
Andrea
### Additional
_No response_
Thanks.
system
Closed
August 23, 2023, 3:34am
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.