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

转TRT失败 #49

Open
lyc728 opened this issue Nov 18, 2024 · 4 comments
Open

转TRT失败 #49

lyc728 opened this issue Nov 18, 2024 · 4 comments

Comments

@lyc728
Copy link

lyc728 commented Nov 18, 2024

trt命令
trtexec --onnx=/data/DocLayout_yolo/models/doclayout_yolo_docstructbench_imgsz1024.onnx --saveEngine=/data/DocLayout_yolo/models/model_best.plan --workspace=300000 --device=0 --noTF32 --verbose
报错信息
[11/18/2024-20:18:54] [E] [TRT] ModelImporter.cpp:773: While parsing node number 673 [Mod -> "/model.23/Mod_output_0"]: [11/18/2024-20:18:54] [E] [TRT] ModelImporter.cpp:774: --- Begin node --- [11/18/2024-20:18:54] [E] [TRT] ModelImporter.cpp:775: input: "/model.23/TopK_1_output_1" input: "/model.23/Constant_12_output_0" output: "/model.23/Mod_output_0" name: "/model.23/Mod" op_type: "Mod" attribute { name: "fmod" i: 0 type:

@JulioZhao97
Copy link
Collaborator

感谢反馈!今天排查一下

@lyc728
Copy link
Author

lyc728 commented Nov 21, 2024

有进展吗?现在我用yolo11训练了一个模型,但是转trt有一点精度损失

@JulioZhao97
Copy link
Collaborator

有进展吗?现在我用yolo11训练了一个模型,但是转trt有一点精度损失

您好,不好意思,之前有点忙,预计周末前给个答复;或者您如果有解决方案可以直接提一个PR

@JulioZhao97
Copy link
Collaborator

@lyc728 您好,现在已经可以转成Tensorrt格式并且推理,经过测试torch==2.5会有bug,具体的环境:

nvidia-tensorrt           99.0.0                   pypi_0    pypi
tensorrt                  8.6.1                    pypi_0    pypi
tensorrt-bindings         8.6.1                    pypi_0    pypi
tensorrt-cu12             10.3.0                   pypi_0    pypi
tensorrt-cu12-bindings    10.3.0                   pypi_0    pypi
tensorrt-cu12-libs        10.3.0                   pypi_0    pypi
tensorrt-libs             8.6.1                    pypi_0    pypi
torch                     2.3.0                    pypi_0    pypi
torchvision               0.18.0                   pypi_0    pypi

转tensorrt:

from doclayout_yolo import YOLOv10
model=YOLOv10("./doclayout_yolo_docstructbench_imgsz1024.pt")
model.export(format='engine', half=True)

推理直接传入导出的.engine模型即可

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

No branches or pull requests

2 participants