Megvii-BaseDetection / Megvii-BaseDetection/YOLOX

torch2trt 转换问题

Open
#1,742 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

我在使用torch2trt转我的yolox模型的时候,原本可以转,但是我是用repvggblock替换原本的cspblock的时候,torch2trt就会失效,不会出现任何错误而是直接中止转换。就像这样(yolox) R:\YOLOX>python tool/trt.py --onlypth
2023-12-07 20:53:47.909 | INFO | main:main:63 - loaded checkpoint done.
[12/07/2023-20:53:50] [TRT] [I] [MemUsageChange] Init CUDA: CPU +776, GPU +0, now: CPU 13024, GPU 2274 (MiB)

(yolox) R:\YOLOX>。但是使用pth to onnx 再从onnx to engine是可行的,但是不会生成model_trt文件。能否告知一下为什么torch2trt不支持repvggblock。或者能提供一个调用python api的推理脚本吗,方便使用engine文件。十分感谢大佬!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading and running tool/trt.py with the reported YOLOX checkpoint and the RepVGGBlock replacement, then compare the torch2trt path with the working ONNX-to-engine path. Done means identifying why conversion stops without an error and either documenting a supported conversion path or providing the requested Python API inference script for the engine file.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
devtools, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.