tinyvision / DAMO-YOLO

DAMO-YOLO: a fast and accurate object detection method with some new techs, including NAS backbones, efficient RepGFPN, ZeroHead, AlignedOTA, and distillation enhancement.
Apache License 2.0
3.79k stars 476 forks source link

doesn't contains class named 'Config #156

Open HongyeCao opened 1 month ago

HongyeCao commented 1 month ago

Before Asking

Search before asking

Question

执行命令python -m torch.distributed.launch --nproc_per_node=1 tools/train.py -f mnt/damo-yolo/configs/damoyolo_tinynasL45_L.py后出现下列信息

/root/miniconda3/envs/DAMO-YOLO/lib/python3.7/site-packages/torch/distributed/launch.py:188: FutureWarning: The module torch.distributed.launch is deprecated and will be removed in future. Use torchrun. Note that --use_env is set by default in torchrun. If your script expects --local_rank argument to be set, please change it to read from os.environ['LOCAL_RANK'] instead. See https://pytorch.org/docs/stable/distributed.html#launch-utility for further instructions

FutureWarning, 2024-10-29 07:50:02.125 | ERROR | main::68 - An error has been caught in function '', process 'MainProcess' (27532), thread 'MainThread' (139870530041664): Traceback (most recent call last):

File "/mnt/damo-yolo/damo/config/base.py", line 123, in get_config_by_file os.path.basename(config_file).split('.')[0]) │ │ │ └ 'mnt/damo-yolo/configs/damoyolo_tinynasL45_L.py' │ │ └ <function basename at 0x7f362523cef0> │ └ <module 'posixpath' from '/root/miniconda3/envs/DAMO-YOLO/lib/python3.7/posixpath.py'> └ <module 'os' from '/root/miniconda3/envs/DAMO-YOLO/lib/python3.7/os.py'>

File "/root/miniconda3/envs/DAMO-YOLO/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) │ │ │ │ │ └ 0 │ │ │ │ └ None │ │ │ └ 0 │ │ └ 'damoyolo_tinynasL45_L' │ └ <function _gcd_import at 0x7f3625368b00> └ <module 'importlib._bootstrap' (frozen)> File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 965, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'damoyolo_tinynasL45_L'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "tools/train.py", line 68, in main() └ <function main at 0x7f3625267d40>

File "tools/train.py", line 56, in main config = parse_config(args.config_file) │ │ └ 'mnt/damo-yolo/configs/damoyolo_tinynasL45_L.py' │ └ Namespace(config_file='mnt/damo-yolo/configs/damoyolo_tinynasL45_L.py', local_rank=0, opts=[], tea_ckpt=None, tea_config=None) └ <function parse_config at 0x7f358132eb90>

File "/mnt/damo-yolo/damo/config/base.py", line 139, in parse_config return get_config_by_file(config_file) │ └ 'mnt/damo-yolo/configs/damoyolo_tinynasL45_L.py' └ <function get_config_by_file at 0x7f358131d320>

File "/mnt/damo-yolo/damo/config/base.py", line 127, in get_config_by_file "{} doesn't contains class named 'Config'".format(config_file)) └ 'mnt/damo-yolo/configs/damoyolo_tinynasL45_L.py'

ImportError: mnt/damo-yolo/configs/damoyolo_tinynasL45_L.py doesn't contains class named 'Config'

Additional

No response

ksv87 commented 3 weeks ago

try torchrun tools/train.py -f mnt/damo-yolo/configs/damoyolo_tinynasL45_L.py also may be you need path /mnt/damo-yolo/configs/damoyolo_tinynasL45_L.py ? or use relative path torchrun tools/train.py -f configs/damoyolo_tinynasL45_L.py