Deep-Learning-YOLOV4实践:ScaledYOLOv4模型训练自己的数据集调试问题总结
error
- error1: CUDA out of memory
- error2:TypeError: can't convert cuda:
- error
Deep-Learning-YOLOV4實踐:ScaledYOLOv4 數(shù)據(jù)集制作
Deep-Learning-YOLOV4實踐:ScaledYOLOv4環(huán)境配置與demo編譯運行
Deep-Learning-YOLOV4實踐:ScaledYOLOv4模型訓練自己的數(shù)據(jù)集調試問題總結
說明:
硬件: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設置過大
解決辦法:
直接將default設置成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代碼運行在cpu中,所以這么寫實對的。
后來改用GPU中代碼運行,因為numpy在cuda中沒有這種表達,需要將cuda中的數(shù)據(jù)轉換到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
【說明】
此錯誤出現(xiàn)于:ScaledYOLOv4-yolov4-csp改進型模型的訓練測試過程
TypeError: not all arguments converted during string formatting
參考鏈接:
解決方案:將yolov4-csp.cfg中的注釋內容去除
總結
以上是生活随笔為你收集整理的Deep-Learning-YOLOV4实践:ScaledYOLOv4模型训练自己的数据集调试问题总结的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DeepLearning:tensorf
- 下一篇: VS编辑器 设置智能提示