iscyy / yoloair

🔥🔥🔥 专注于YOLOv5,YOLOv7、YOLOv8、YOLOv9改进模型,Support to improve backbone, neck, head, loss, IoU, NMS and other modules🚀
https://github.com/iscyy/yoloair
GNU General Public License v3.0
2.51k stars 430 forks source link

从头训练yolox模型,报错 'DetectX' object has no attribute 'anchors' #68

Closed 985zhangguoxu closed 2 years ago

985zhangguoxu commented 2 years ago

Plotting labels to runs/train/exp4/labels.jpg... Traceback (most recent call last): File "/home/innovation/zgx/yoloair-main/train.py", line 695, in main(opt) File "/home/innovation/zgx/yoloair-main/train.py", line 591, in main train(opt.hyp, opt, device, callbacks) File "/home/innovation/zgx/yoloair-main/train.py", line 254, in train check_anchors(dataset, model=model, thr=hyp['anchor_t'], imgsz=imgsz) File "/home/innovation/zgx/yoloair-main/utils/autoanchor.py", line 43, in check_anchors anchors = m.anchors.clone() * m.stride.to(m.anchors.device).view(-1, 1, 1) # current anchors File "/home/innovation/anaconda3/envs/yoloair/lib/python3.7/site-packages/torch/nn/modules/module.py", line 779, in getattr type(self).name, name)) torch.nn.modules.module.ModuleAttributeError: 'DetectX' object has no attribute 'anchors'

键入的命令是:python /home/innovation/zgx/yoloair-main/train.py --data /home/innovation/zgx/yoloair-main/data/VOC.yaml --weights '' --cfg /home/innovation/zgx/yoloair-main/configs/yolox-Improved/yolox_acmix_backbone.yaml --img 640

请问该如何解决?谢谢

Luxiangxianghy commented 2 years ago

add --noautoanchor