Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yolov7训练出错 #27

Open
jo-dean opened this issue Aug 13, 2022 · 0 comments
Open

yolov7训练出错 #27

jo-dean opened this issue Aug 13, 2022 · 0 comments

Comments

@jo-dean
Copy link

jo-dean commented Aug 13, 2022

命令:python train.py --mode yolov7 --use_aux True --data garbage.yaml --cfg yolov7.yaml --weights weights/yolov7/yolov7.pt --batch-size 8
出现错误
**Logging results to runs/train/exp14
Starting training for 100 epochs...

 Epoch   gpu_mem       box       obj       cls    labels  img_size

0%| | 0/5 [00:01<?, ?it/s]
Traceback (most recent call last):
File "train.py", line 772, in
main(opt)
File "train.py", line 670, in main
train(opt.hyp, opt, device, callbacks)
File "train.py", line 448, in train
loss, loss_items = compute_loss(pred, targets.to(device), imgs) # init loss class
File "YOLOU/utils/loss.py", line 992, in call
bs_aux, as_aux_, gjs_aux, gis_aux, targets_aux, anchors_aux = self.build_targets2(p[:self.nl], targets, imgs)
File "YOLOU/utils/loss.py", line 1202, in build_targets2
indices, anch = self.find_5_positive(p, targets)
File "YOLOU/utils/loss.py", line 1388, in find_5_positive
indices.append((b, a, gj.clamp_(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1))) # image, anchor, grid indices
RuntimeError: result type Float can't be cast to the desired output type long int
**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant