记录跑yolov5时,遇到的一个问题

今天运行yolov5时,遇到一个bug.后面发现batchsize设置过大造成的。将batch-size设置小一些,问题得到解决

     Epoch   gpu_mem       box       obj       cls    labels  img_size
  0%|          | 0/296 [00:00<?, ?it/s]                                                                                                                                                                              
Traceback (most recent call last):
  File "train.py", line 644, in <module>
    main(opt)
  File "train.py", line 540, in main
    train(opt.hyp, opt, device, callbacks)
  File "train.py", line 315, in train
    pred = model(imgs)  # forward
  File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/root/autodl-tmp/yolov5-master/models/yolo.py", line 217, in forward
    return self._forward_once(x, profile, visualize)  # single-scale inference, train
  File "/root/autodl-tmp/yolov5-master/models/yolo.py", line 130, in _forward_once
    x = m(x)  # run
  File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/root/autodl-tmp/yolov5-master/models/yolo.py", line 64, in forward
    x[i] = self.m[i](x[i])  # conv
  File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 423, in forward
    return self._conv_forward(input, self.weight)
  File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 419, in _conv_forward
    return F.conv2d(input, weight, self.bias, self.stride,
RuntimeError: Unable to find a valid cuDNN algorithm to run convolution

你可能感兴趣的:(随手记,YOLO,深度学习,python)