Megvii-BaseDetection / Megvii-BaseDetection/YOLOX
model.head.decode_in_inference = False 导致torch.jit.trace之后的的输出不对
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
正常运行tools/demo.py,trt = False,这个时候model.head.decode_in_inference = True,能得到预期输出。
正常运行tools/export_torchscript.py,这个时候model.head.decode_in_inference = False,成功保存下来model.pt。
一:
model = torch.jit.load('model.pt')
model.eval()
trace_output = model(img)
二:
demo.py的158行
demo_outputs = self.model(img)
trace_output和demo_outputs不一样。
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two inference paths described in tools/export_torchscript.py and tools/demo.py, including demo.py line 158. Compare the loaded TorchScript model's output with the demo model output while checking the different decode_in_inference settings. Done means the cause of the mismatch is identified and the two outputs agree under the intended inference path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100