Megvii-BaseDetection / Megvii-BaseDetection/YOLOX

raise ImportError("{} doesn't contains class named 'Exp'".format(exp_file)) ImportError: exps/default/nano.py doesn't contains class named 'Exp'

Open
#784 8 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

li@li-desktop:~/Desktop/YOLOX-main$ python3 tools/demo.py image -f exps/default/nano.py -c yolox_nano.pth --path assets/dog.jpg --conf 0.25 --nms 0.45 --tsize 640 --save_result --device gpu

Traceback (most recent call last):
File "/home/li/Desktop/YOLOX-main/yolox/exp/build.py", line 13, in get_exp_by_file
current_exp = importlib.import_module(os.path.basename(exp_file).split(".")[0])
File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 674, in exec_module
File "", line 781, in get_code
File "", line 741, in source_to_code
File "", line 219, in _call_with_frames_removed
File "exps/default/nano.py", line 36
backbone = YOLOPAFPN(self.depth, self.width, in_channels=in_channels, self.act, depthwise=True)
^
SyntaxError: positional argument follows keyword argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "tools/demo.py", line 312, in
exp = get_exp(args.exp_file, args.name)
File "/home/li/Desktop/YOLOX-main/yolox/exp/build.py", line 51, in get_exp
return get_exp_by_file(exp_file)
File "/home/li/Desktop/YOLOX-main/yolox/exp/build.py", line 16, in get_exp_by_file
raise ImportError("{} doesn't contains class named 'Exp'".format(exp_file))
ImportError: exps/default/nano.py doesn't contains class named 'Exp'

1

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 at exps/default/nano.py line 36, where the traceback reports the syntax error while loading the experiment file. Check the YOLOPAFPN call's argument ordering, then rerun the tools/demo.py command from the issue; done means the experiment imports successfully without the misleading ImportError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.