Laughing-q / yolov5_annotations

annotations of yolov5-5.0
GNU General Public License v3.0
232 stars 63 forks source link

启动训练报错,Can't get attribute 'SPPF' on <module 'models.common' #3

Closed liudatutu closed 2 years ago

liudatutu commented 2 years ago

非常感谢大佬的注释和详解,我在运行训练的时候报错,请问有解决方法么? Traceback (most recent call last): File "train.py", line 931, in main(opt) File "train.py", line 796, in main train(opt.hyp, opt, device) File "train.py", line 122, in train run_id = torch.load(weights).get('wandb_id') if weights.endswith('.pt') and os.path.isfile(weights) else None File "/home/ai/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 607, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/ai/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 882, in _load result = unpickler.load() File "/home/ai/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 875, in find_class return super().find_class(mod_name, name) AttributeError: Can't get attribute 'SPPF' on <module 'models.common' from '/home/ai/sda/MyCode/yolov5_annotations-master/models/common.py'>

Laughing-q commented 2 years ago

@liudatutu 我这个注释代码是今年七月份的代码了,现在官方yolov5已经更新6.0了,这个问题是6.0版本的SPPF模块我这个版本代码里没有,你应该下载的最新的权重,只能用官方代码运行哈。 对了,我这个只是注释版本哈,当时想的是出注释给大家看的,emmm所以就不是很建议直接用我这个运行哈,最好用官网的运行哈

liudatutu commented 2 years ago

@Laughing-q 非常感谢,那我用官方的试试。