PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

评估时内存溢出

Open playgit2001 opened this issue 2 years ago • 10 comments

PP-OCRv3 检测的预训练模型,icdar2015训练集,我用它做评估,发现超出内存,batch_size已经调小到2了 Out of memory error on GPU 0. Cannot allocate 1.189819GB memory on GPU 0, 7.999390GB memory has been allocated and available memory is only 0.000000B.

playgit2001 avatar Oct 17 '22 12:10 playgit2001

watch nvidia-smi 看下你的GPU上是否有其他程序在占用显存

LDOUBLEV avatar Oct 18 '22 02:10 LDOUBLEV

我用nvidia-smi查看了一下,没有运行前 261MiB / 8192MiB,运行后马上7479MiB / 8192MiB。

playgit2001 avatar Oct 18 '22 06:10 playgit2001

每次都是eval进度到49%,然后卡住,报错

playgit2001 avatar Oct 18 '22 06:10 playgit2001

是什么原因呢,我文字识别做训练的时候,数据集比文字检测的大,但在调低batch_size的情况下,也能正常训练。然后还有一个问题,训练的时候 eval model: 49%|█████████████████████████████████ |176/356[01:39<01:41, 1.77it/s] 后面这个1.77it比我文字识别小了好多。

playgit2001 avatar Oct 18 '22 06:10 playgit2001

@LDOUBLEV

playgit2001 avatar Oct 18 '22 12:10 playgit2001

我也遇到了这个问题,我把配置文件中的Eval部分的loader里的num_workers: 8,改成了0,就可以了。

drenched9 avatar Oct 19 '22 07:10 drenched9

@drenched9 我已经都调成0了

playgit2001 avatar Oct 19 '22 07:10 playgit2001

@playgit2001 你最上面说你batch_size调到2了,这个是训练的batch_size还是评估的呢?我刚刚又看了一眼,评估的batch_size_per_card默认就是1,而且注释了# must be 1。

drenched9 avatar Oct 19 '22 07:10 drenched9

@drenched9 训练的调成2了,评估那个must be1 ,我就没调了

playgit2001 avatar Oct 19 '22 07:10 playgit2001

配置有问题吧,看看你是不是这个原因导致的 https://github.com/PaddlePaddle/PaddleOCR/issues/6989

yangy996 avatar Oct 27 '22 06:10 yangy996