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.47k stars 428 forks source link

AttributeError: 'collections.OrderedDict' object has no attribute 'float' WHEN TRAIN YOLOX MODEL #149

Closed jayphone17 closed 1 year ago

jayphone17 commented 1 year ago

BUG REPORT

When I use following command to train YoloX Model

python train.py --weights weights/yolox_s.pt --cfg configs/yolox/yolox-s.yaml --data data/MyCustomDataSet.yaml --device 1,2,3,4 --batch-size 64 --epoch 300

it appears BUG like:

Traceback (most recent call last): File "train.py", line 695, in main(opt) File "train.py", line 591, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 128, in train csd = ckpt['model'].float().state_dict() # checkpoint state_dict as FP32 AttributeError: 'collections.OrderedDict' object has no attribute 'float'

I haved downloaded the weight yolox_s.pt from https://github.com/Megvii-BaseDetection/YOLOX to self-created folder "weights"

iscyy commented 1 year ago

You can use yolox-s.pt in Assets