DAMO-YOLO: a fast and accurate object detection method with some new techs, including NAS backbones, efficient RepGFPN, ZeroHead, AlignedOTA, and distillation enhancement.
[X] I have read the README carefully. 我已经仔细阅读了README上的操作指引。
[X] I want to train my custom dataset, and I have read the tutorials for finetune on your data carefully and organize my dataset correctly; 我想训练自定义数据集,我已经仔细阅读了训练自定义数据的教程,以及按照正确的目录结构存放数据集。
[X] I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。
Search before asking
[X] I have searched the DAMO-YOLO issues and found no similar questions.
Traceback (most recent call last):
File "C:\Users\lenovo\Desktop\DAMO-YOLO-master\tools\demo.py", line 12, in <module>
from damo.base_models.core.ops import RepConv
ModuleNotFoundError: No module named 'damo'
def make_parser():
parser = argparse.ArgumentParser('DAMO-YOLO Demo')
parser.add_argument('--input_type',
default='image',
help="input type, support [image, video, camera]")
parser.add_argument('-f',
'--config_file',
default='./configs/damoyolo_tinynasL25_S.py',
type=str,
help='pls input your config file',)
parser.add_argument('-p',
'--path',
default='./assets/dog.jpg',
type=str,
help='path to image or video')
parser.add_argument('--camid',
type=int,
default=0,
help='camera id, necessary when input_type is camera')
parser.add_argument('--engine',
default='./damoyolo_tinynasL25_S.pth',
type=str,
help='engine for inference')
parser.add_argument('--device',
default='cpu',
type=str,
help='device used to inference')
parser.add_argument('--output_dir',
default='./demo',
type=str,
help='where to save inference results')
parser.add_argument('--conf',
default=0.6,
type=float,
help='conf of visualization')
parser.add_argument('--infer_size',
default=[640,640],
nargs='+',
type=int,
help='test img size')
parser.add_argument('--end2end',
action='store_true',
help='trt engine with nms')
parser.add_argument('--save_result',
default=True,
type=bool,
help='whether save visualization results')
return parser
但是报错:
2023-05-11 22:12:48.369 | ERROR | __main__:<module>:367 - An error has been caught in function '<module>', process 'MainProcess' (1520), thread 'MainThread' (11440):
Traceback (most recent call last):
File "C:\Users\lenovo\Desktop\DAMO-YOLO-master\damo\config\base.py", line 122, in get_config_by_file
current_config = importlib.import_module(
│ └ <function import_module at 0x000001FBB854A160>
└ <module 'importlib' from 'D:\\Python\\lib\\importlib\\__init__.py'>
File "D:\Python\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
│ │ │ │ │ └ 0
│ │ │ │ └ None
│ │ │ └ 0
│ │ └ 'damoyolo_tinynasL25_S'
│ └ <function _gcd_import at 0x000001FBB83A13A0>
└ <module 'importlib._bootstrap' (frozen)>
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'damoyolo_tinynasL25_S'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
> File "C:\Users\lenovo\Desktop\DAMO-YOLO-master\tools\demo.py", line 367, in <module>
main()
└ <function main at 0x000001FBD1B571F0>
File "C:\Users\lenovo\Desktop\DAMO-YOLO-master\tools\demo.py", line 323, in main
config = parse_config(args.config_file)
│ │ └ './configs/damoyolo_tinynasL25_S.py'
│ └ Namespace(input_type='image', config_file='./configs/damoyolo_tinynasL25_S.py', path='./assets/dog.jpg', camid=0, engine='./d...
└ <function parse_config at 0x000001FBD1B52A60>
File "C:\Users\lenovo\Desktop\DAMO-YOLO-master\damo\config\base.py", line 139, in parse_config
return get_config_by_file(config_file)
│ └ './configs/damoyolo_tinynasL25_S.py'
└ <function get_config_by_file at 0x000001FBD1B29940>
File "C:\Users\lenovo\Desktop\DAMO-YOLO-master\damo\config\base.py", line 126, in get_config_by_file
raise ImportError(
ImportError: ./configs/damoyolo_tinynasL25_S.py doesn't contains class named 'Config'
Before Asking
[X] I have read the README carefully. 我已经仔细阅读了README上的操作指引。
[X] I want to train my custom dataset, and I have read the tutorials for finetune on your data carefully and organize my dataset correctly; 我想训练自定义数据集,我已经仔细阅读了训练自定义数据的教程,以及按照正确的目录结构存放数据集。
[X] I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。
Search before asking
Question
我下载了最新的代码,按照操作指引,在win10系统cmd中运行:
但是报错:
我确定我的工作目录是:
接着我尝试运行tools文件夹下的demo.py函数,我将make_parser函数中的参数与示例中的代码对齐:
但是报错:
程序找不到damoyolo_tinynasL25_S.py文件中的Config类,但是当我打开damoyolo_tinynasL25_S.py文件时看到了Config,我不明白发生了什么,期望能得到解决方案。
Additional
我的确是在DAMO-YOLO-master主文件夹下运行的
也配置了环境
但是还是出现上述情况