Traceback (most recent call last):


 "train.py", line 461, in <module>

train(args, loader, generator, discriminator, g_optim, d_optim, g_ema, device)


 "train.py", line 225, in train

(args.r1 / 2 * r1_loss * args.d_reg_every + 0 * real_pred[0]).backward()


 "/home/leo/code/core/venv_leo/lib/python3.6/site-packages/torch/tensor.py", line 185, in backward

torch.autograd.backward(self, gradient, retain_graph, create_graph)


 "/home/leo/code/core/venv_leo/lib/python3.6/site-packages/torch/autograd/__init__.py", line 127, in backward

allow_unreachable=True)
# allow_unreachable flag
RuntimeError: CUDA out of memory. Tried to allocate 512.00 MiB (GPU 2; 10.76 GiB total capacity; 8.85 GiB already allocated; 212.31 MiB free; 9.60 GiB reserved in total by PyTorch)

Traceback (most recent call last):


 "train.py", line 405, in <module>

train(hyp)


 "train.py", line 294, in train

results, maps, times = test.test(opt.data,


 "C:\Users\waicool20\Programming\python\yolov5\test.py", line 92, in test

output = non_max_suppression(inf_out, conf_thres=conf_thres, iou_thres=iou_thres, merge=merge)


 "C:\Users\waicool20\Programming\python\yolov5\utils\utils.py", line 612, in non_max_suppression

i = torchvision.ops.boxes.nms(boxes, scores, iou_thres)


 "c:\Python38\lib\site-packages\torchvision\ops\boxes.py", line 35, in nms

return torch.ops.torchvision.nms(boxes, scores, iou_threshold)
RuntimeError: CUDA out of memory. Tried to allocate 7.11 GiB (GPU 0; 11.00 GiB total capacity; 178.01 MiB already allocated; 6.98 GiB free; 2.30 GiB reserved in total by PyTorch)
