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

CUDA error: out of memory #10

Open
DLYL2019 opened this issue Jan 27, 2021 · 1 comment
Open

CUDA error: out of memory #10

DLYL2019 opened this issue Jan 27, 2021 · 1 comment

Comments

@DLYL2019
Copy link

你好,显卡GTX2080Ti,设置batch_size为2了,为什么运行train.py出现
Traceback (most recent call last):
File "F:/YL_file/compite/yoloV5/yolov5/train.py", line 395, in
train(hyp)
File "F:/YL_file/compite/yoloV5/yolov5/train.py", line 81, in train
model = Model(opt.cfg, nc=data_dict['nc']).to(device)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 432, in to
return self._apply(convert)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 208, in _apply
module._apply(fn)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 208, in _apply
module._apply(fn)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 208, in _apply
module._apply(fn)
[Previous line repeated 1 more time]
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 230, in _apply
param_applied = fn(param)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 430, in convert
return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
RuntimeError: CUDA error: out of memory

@DLLXW
Copy link
Owner

DLLXW commented Jan 28, 2021

如果不是尺度太大,那就是你有其它进程占用了显卡,你仔细检查下吧。batch=2,就算是1024的输入尺度也不会超显存的

你好,显卡GTX2080Ti,设置batch_size为2了,为什么运行train.py出现
Traceback (most recent call last):
File "F:/YL_file/compite/yoloV5/yolov5/train.py", line 395, in
train(hyp)
File "F:/YL_file/compite/yoloV5/yolov5/train.py", line 81, in train
model = Model(opt.cfg, nc=data_dict['nc']).to(device)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 432, in to
return self._apply(convert)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 208, in _apply
module._apply(fn)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 208, in _apply
module._apply(fn)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 208, in _apply
module._apply(fn)
[Previous line repeated 1 more time]
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 230, in _apply
param_applied = fn(param)
File "G:\vision\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 430, in convert
return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
RuntimeError: CUDA error: out of memory

如果不是尺度太大,那就是你有其它进程占用了显卡,你仔细检查下吧。batch=2,就算是1024的输入尺度也不会超显存的

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

2 participants