Deep-Learning-YOLOV4实践:ScaledYOLOv4模型训练自己的数据集调试问题总结
error
- error1: CUDA out of memory
- error2:TypeError: can't convert cuda:
- error
Deep-Learning-YOLOV4實(shí)踐:ScaledYOLOv4 數(shù)據(jù)集制作
Deep-Learning-YOLOV4實(shí)踐:ScaledYOLOv4環(huán)境配置與demo編譯運(yùn)行
Deep-Learning-YOLOV4實(shí)踐:ScaledYOLOv4模型訓(xùn)練自己的數(shù)據(jù)集調(diào)試問題總結(jié)
說明:
硬件:rtx2060
error1: CUDA out of memory
RuntimeError: CUDA out of memory. Tried to allocate 88.00 MiB (GPU 0; 6.00 GiB total capacity; 4.08 GiB already allocated; 22.63 MiB free; 4.20 GiB reserved in total by PyTorch)
原因:
bach_size設(shè)置過大
解決辦法:
直接將default設(shè)置成1:
error2:TypeError: can’t convert cuda:
TypeError: can’t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
原因:
原來Pytorch代碼運(yùn)行在cpu中,所以這么寫實(shí)對(duì)的。
后來改用GPU中代碼運(yùn)行,因?yàn)閚umpy在cuda中沒有這種表達(dá),需要將cuda中的數(shù)據(jù)轉(zhuǎn)換到cpu中,再去使用numpy。
解決方案:模型自帶代碼:
if dtype is None:return self.numpy() else:return self.numpy().astype(dtype, copy=False)模型修改之后的代碼:
if dtype is None:return self.cuda().data.cpu().numpy() else:return self.cuda().data.cpu().numpy().astype(dtype, copy=False)error
【說明】
此錯(cuò)誤出現(xiàn)于:ScaledYOLOv4-yolov4-csp改進(jìn)型模型的訓(xùn)練測(cè)試過程
TypeError: not all arguments converted during string formatting
參考鏈接:
解決方案:將yolov4-csp.cfg中的注釋內(nèi)容去除
總結(jié)
以上是生活随笔為你收集整理的Deep-Learning-YOLOV4实践:ScaledYOLOv4模型训练自己的数据集调试问题总结的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DeepLearning:tensorf
- 下一篇: C++:常用数据类型及常见操作