Megvii-BaseDetection / Megvii-BaseDetection/YOLOX

TypeError: __init__() got an unexpected keyword argument 'legacy'

Open
#878 5 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

运行程序时出现以下错误提示,如何解决?
$python tools\demo.py video -n yolox-x -c ..\weights\yolox\yolox_x.pth --path MOT16-03.mp4 --conf 0.25 --nms 0.4 --tsize 640 --save_result --device gpu
2021-11-05 22:50:29.807 | INFO | main:main:255 - Args: Namespace(camid=0, ckpt='..\weights\yolox\yolox_x.pth', conf=0.25, demo='video', device='gpu', exp_file=None, experiment_name='yolox_x', fp16=False, fuse=False, legacy=False, name='yolox-x', nms=0.4, path='MOT16-03.mp4', save_result=True, trt=False, tsize=640)
2021-11-05 22:50:30.537 | INFO | main:main:265 - Model Summary: Params: 99.07M, Gflops: 281.93
2021-11-05 22:50:33.059 | INFO | main:main:278 - loading checkpoint
2021-11-05 22:50:33.510 | INFO | main:main:282 - loaded checkpoint done.
Traceback (most recent call last):
File "tools\demo.py", line 316, in
main(exp, args)
File "tools\demo.py", line 303, in main
args.device, args.fp16, args.legacy,
File "tools\demo.py", line 121, in init
self.preproc = ValTransform(legacy=legacy)
TypeError: init() got an unexpected keyword argument 'legacy'

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 in tools/demo.py at the ValTransform(legacy=legacy) call shown in the traceback, then inspect the ValTransform constructor it imports. Re-run the supplied video command after making the compatibility change; done means the unexpected-keyword error is gone and video processing starts.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.