Traceback (most recent call last):
File “D:\Anaconda\Scripts\yolo-script.py”, line 33, in
sys.exit(load_entry_point(‘ultralytics==8.0.83’, ‘console_scripts’, ‘yolo’)())
self.model, self.save = parse_model(deepcopy(self.yaml), ch=ch, verbose=verbose) # model, savelist
File “D:\Anaconda\lib\site-packages\ultralytics-8.0.83-py3.8.egg\ultralytics\nn\tasks.py”, line 465, in parse_model
m = getattr(torch.nn, m[3:]) if ‘nn.’ in m else globals()[m] # get module
KeyError: ‘space_to_depth’
Sentry is attempting to send 2 pending error messages
Waiting up to 2 seconds
Press Ctrl-Break to quit
项目场景:
我发现目前很多同学在使用YOLOv8
添加了自己的模块后都会出现这个报错。
问题描述:
比如我首先在ultralytics/nn/modules.py
文件中添加了space_t