keras-yolo3 icon indicating copy to clipboard operation
keras-yolo3 copied to clipboard

利用单gpu训练,速度还是很慢

Open codeseeking opened this issue 4 years ago • 25 comments

gpu的利用率只有14%,而且还是周期波动的,一会0,一会变成14%

codeseeking avatar Jul 31 '19 02:07 codeseeking

gpu的利用率只有14%,而且还是周期波动的,一会0,一会变成14%

试着把batch size调大点。这说明GPU没有饱和。喂给GPU的数据不够GPU消耗

cosimo17 avatar Aug 09 '19 05:08 cosimo17

但是batch size社大了显存不够了

| | 杨定康 | | 邮箱:[email protected] |

签名由 网易邮箱大师 定制

在2019年08月09日 13:29,QiJia 写道:

gpu的利用率只有14%,而且还是周期波动的,一会0,一会变成14%

试着把batch size调大点。这说明GPU没有饱和。喂给GPU的数据不够GPU消耗

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

codeseeking avatar Aug 09 '19 07:08 codeseeking

但是batch size社大了显存不够了 | | 杨定康 | | 邮箱:[email protected] | 签名由 网易邮箱大师 定制 在2019年08月09日 13:29,QiJia 写道: gpu的利用率只有14%,而且还是周期波动的,一会0,一会变成14% 试着把batch size调大点。这说明GPU没有饱和。喂给GPU的数据不够GPU消耗 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

你多大显存?

cosimo17 avatar Aug 09 '19 07:08 cosimo17

1080ti显卡

| | 杨定康 | | 邮箱:[email protected] |

签名由 网易邮箱大师 定制

在2019年08月09日 15:15,QiJia 写道:

但是batch size社大了显存不够了 | | 杨定康 | | 邮箱:[email protected] | 签名由 网易邮箱大师 定制 在2019年08月09日 13:29,QiJia 写道: gpu的利用率只有14%,而且还是周期波动的,一会0,一会变成14% 试着把batch size调大点。这说明GPU没有饱和。喂给GPU的数据不够GPU消耗 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

你多大显存?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

codeseeking avatar Aug 09 '19 07:08 codeseeking

1080ti显卡 | | 杨定康 | | 邮箱:[email protected] | 签名由 网易邮箱大师 定制 在2019年08月09日 15:15,QiJia 写道: 但是batch size社大了显存不够了 | | 杨定康 | | 邮箱:[email protected] | 签名由 网易邮箱大师 定制 在2019年08月09日 13:29,QiJia 写道: gpu的利用率只有14%,而且还是周期波动的,一会0,一会变成14% 试着把batch size调大点。这说明GPU没有饱和。喂给GPU的数据不够GPU消耗 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread. 你多大显存? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

应该是哪里有问题。不然不可能这么低。我泰坦X训练起来占用率都在60以上的。你检查下cuda,cudnn什么的。跑个其它训练代码,看看占用率正常不。

cosimo17 avatar Aug 09 '19 07:08 cosimo17

好的,谢谢你的解答

| | 杨定康 | | 邮箱:[email protected] |

签名由 网易邮箱大师 定制

在2019年08月09日 15:19,QiJia 写道:

1080ti显卡 | | 杨定康 | | 邮箱:[email protected] | 签名由 网易邮箱大师 定制 在2019年08月09日 15:15,QiJia 写道: 但是batch size社大了显存不够了 | | 杨定康 | | 邮箱:[email protected] | 签名由 网易邮箱大师 定制 在2019年08月09日 13:29,QiJia 写道: gpu的利用率只有14%,而且还是周期波动的,一会0,一会变成14% 试着把batch size调大点。这说明GPU没有饱和。喂给GPU的数据不够GPU消耗 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread. 你多大显存? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

应该是哪里有问题。不然不可能这么低。我泰坦X训练起来占用率都在60以上的。你检查下cuda,cudnn什么的。跑个其它训练代码,看看占用率正常不。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

codeseeking avatar Aug 09 '19 07:08 codeseeking

把units下面的get_random_data里的distort image,这部分注释掉,这个太吃cpu了,我就是CPU满载,然后也是你那样了,注释掉之后就正常了,但要加一行image_data = np.array(image)/255.

azsxza avatar Aug 10 '19 18:08 azsxza

谢谢,但是改了之后还是周期性的0-23的循环,不知道你有没有解决?

| | 杨定康 | | 邮箱:[email protected] |

签名由 网易邮箱大师 定制

在2019年08月11日 02:21,az631132770 写道:

把units下面的get_random_data里的distort image,这部分注释掉,这个太吃cpu了,我就是CPU满载,然后也是你那样了,注释掉之后就正常了,但要加一行image_data = np.array(image)/255.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

codeseeking avatar Aug 12 '19 00:08 codeseeking

谢谢,但是改了之后还是周期性的0-23的循环,不知道你有没有解决? | | 杨定康 | | 邮箱:[email protected] | 签名由 网易邮箱大师 定制 在2019年08月11日 02:21,az631132770 写道: 把units下面的get_random_data里的distort image,这部分注释掉,这个太吃cpu了,我就是CPU满载,然后也是你那样了,注释掉之后就正常了,但要加一行image_data = np.array(image)/255. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

那你试试直接把那个函数的参数里的random设置成false,我把我说的那一块注释掉后就正常了,维持在70%-80%

azsxza avatar Aug 12 '19 04:08 azsxza

说到底还是预处理太多了,gpu 利用率太低

xxllp avatar Aug 13 '19 09:08 xxllp

不太明白,才刚接触

在 2019-08-13 16:19:14,"potter" [email protected] 写道:

说到底还是预处理太多了,gpu 利用率太低

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

codeseeking avatar Aug 13 '19 09:08 codeseeking

我也遇到了同样的问题,单GPU训练,显存占满了,但是利用率很低,请问你现在解决了吗?

latte193 avatar Sep 05 '19 07:09 latte193

没有解决

发自网易邮箱大师

在2019年9月5日 15:49,Johanna[email protected] 写道:

我也遇到了同样的问题,单GPU训练,显存占满了,但是利用率很低,请问你现在解决了吗?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

codeseeking avatar Sep 10 '19 12:09 codeseeking

好吧,谢谢


Regards,

Jinghan Yang,

Academy of Mathematics and Systems Science, Chinese Academy of Sciences

Beijing, China

------------------ Original ------------------ From: "mhealth"[email protected]; Date: 2019年9月10日(星期二) 晚上8:45 To: "qqwweee/keras-yolo3"[email protected]; Cc: "杨婧涵"[email protected]; "Comment"[email protected]; Subject: Re: [qqwweee/keras-yolo3] 利用单gpu训练,速度还是很慢 (#524)

没有解决

发自网易邮箱大师

在2019年9月5日 15:49,Johanna[email protected] 写道:

我也遇到了同样的问题,单GPU训练,显存占满了,但是利用率很低,请问你现在解决了吗?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

latte193 avatar Sep 11 '19 01:09 latte193

@latte193 请问有发现原因吗?我这边是显存占满了,但是GPU CPU利用率都很低

tachikoma777 avatar Sep 18 '19 06:09 tachikoma777

我也是这样的情况,目前没有找到原因所在。我的GPU显存占满,利用率只有10%不到,很头大。


Regards,

Jinghan Yang,

Academy of Mathematics and Systems Science, Chinese Academy of Sciences

Beijing, China

------------------ Original ------------------ From: "chen3718"[email protected]; Date: 2019年9月18日(星期三) 下午2:45 To: "qqwweee/keras-yolo3"[email protected]; Cc: "杨婧涵"[email protected]; "Mention"[email protected]; Subject: Re: [qqwweee/keras-yolo3] 利用单gpu训练,速度还是很慢 (#524)

@latte193 请问有发现原因吗?我这边是显存占满了,但是GPU CPU利用率都很低

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

latte193 avatar Sep 23 '19 08:09 latte193

我也是这样的情况,目前没有找到原因所在。我的GPU显存占满,利用率只有10%不到,很头大。 ------------------ Regards, Jinghan Yang, Academy of Mathematics and Systems Science, Chinese Academy of Sciences Beijing, China ------------------ Original ------------------ From: "chen3718"[email protected]; Date: 2019年9月18日(星期三) 下午2:45 To: "qqwweee/keras-yolo3"[email protected]; Cc: "杨婧涵"[email protected]; "Mention"[email protected]; Subject: Re: [qqwweee/keras-yolo3] 利用单gpu训练,速度还是很慢 (#524) @latte193 请问有发现原因吗?我这边是显存占满了,但是GPU CPU利用率都很低 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

感觉是单worker在读取数据,这期间GPU就不工作,watch -n看GPU都是随着每个step占用率周期变化的

tachikoma777 avatar Sep 24 '19 06:09 tachikoma777

嗯嗯,有可能,我读入数据的地方应该有点问题,不过最近在忙其他事情,还没有试过,待我尝试了有结果再告诉你。


Regards,

Jinghan Yang,

Academy of Mathematics and Systems Science, Chinese Academy of Sciences

Beijing, China

------------------ 原始邮件 ------------------ 发件人: "chen3718"[email protected]; 发送时间: 2019年9月24日(星期二) 下午2:22 收件人: "qqwweee/keras-yolo3"[email protected]; 抄送: "杨婧涵"[email protected]; "Mention"[email protected]; 主题: Re: [qqwweee/keras-yolo3] 利用单gpu训练,速度还是很慢 (#524)

我也是这样的情况,目前没有找到原因所在。我的GPU显存占满,利用率只有10%不到,很头大。 … ------------------ Regards, Jinghan Yang, Academy of Mathematics and Systems Science, Chinese Academy of Sciences Beijing, China ------------------ Original ------------------ From: "chen3718"[email protected]; Date: 2019年9月18日(星期三) 下午2:45 To: "qqwweee/keras-yolo3"[email protected]; Cc: "杨婧涵"[email protected]; "Mention"[email protected]; Subject: Re: [qqwweee/keras-yolo3] 利用单gpu训练,速度还是很慢 (#524) @latte193 请问有发现原因吗?我这边是显存占满了,但是GPU CPU利用率都很低 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

感觉是单worker在读取数据,这期间GPU就不工作,watch -n看GPU都是随着每个step占用率周期变化的

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

latte193 avatar Sep 24 '19 06:09 latte193

你好,我也是单GPU 运行出现模块无法导入,请问你的单GPU遇见了吗? from keras.utils import multi_gpu_model ImportError: cannot import name 'multi_gpu_model'

kentx avatar Oct 06 '19 15:10 kentx

倒没有模块无法导入的问题


Regards,

Jinghan Yang,

Academy of Mathematics and Systems Science, Chinese Academy of Sciences

Beijing, China

------------------ 原始邮件 ------------------ 发件人: "kentx"[email protected]; 发送时间: 2019年10月6日(星期天) 晚上11:26 收件人: "qqwweee/keras-yolo3"[email protected]; 抄送: "杨婧涵"[email protected]; "Mention"[email protected]; 主题: Re: [qqwweee/keras-yolo3] 利用单gpu训练,速度还是很慢 (#524)

你好,我也是单GPU 运行出现模块无法导入,请问你的单GPU遇见了吗? from keras.utils import multi_gpu_model ImportError: cannot import name 'multi_gpu_model'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

latte193 avatar Oct 11 '19 07:10 latte193

我也是GPU 1660 6G显存 但是运行训练就报错: failed to allocate 4.83G (5184278528 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY 。。。。。 有人知道什么原因么? 谢谢 跟踪发现 这句一运行model_body = yolo_body(image_input, num_anchors//3, num_classes) 就报上面的错 。。。

vc815 avatar Oct 25 '19 11:10 vc815

@vc815 CUDA_ERROR_OUT_OF_MEMORY,很明显啊,GPU没有显存空间了,你是小白吧?加少batch_size吧,把Adam优化器换成SGD

leo-XUKANG avatar May 18 '20 03:05 leo-XUKANG

这问题有人解决了吗? 还是遇到这个问题。

donaldlee2008 avatar Jun 15 '20 20:06 donaldlee2008

有人解决的吗?我现在也是我2080Ti利用率都没过过3%,cuda计算也是震荡,基本0-50波动

XiaokangLiuCUG avatar Jun 03 '21 09:06 XiaokangLiuCUG

有人解决的吗?我现在也是我2080Ti利用率都没过过3%,cuda计算也是震荡,基本0-50波动

我的问题已经解决了,是因为图片尺寸太大每个batch预处理时间过长过长,导致显卡拿不到数据,才一直在波动,望能帮到诸位

XiaokangLiuCUG avatar Jun 07 '21 07:06 XiaokangLiuCUG