cuda: out of memory
使用ResNet50-imageNet模型进行预测,use_gpu=True, trainer_count=2,batch_size=128,大约预测20w样本后就会报cuda out of memory. 当我改成batch_size=64之后,问题同样复现,也是大约20w样本后报错。
infer时使用nvidia-smi观察,可以看到两个GPU的显存很大的波动, 其中1号GPU有缓慢上升,超过100%后报错退出。
paddle version:
PaddlePaddle 0.11.0, compiled with
with_avx: ON
with_gpu: ON
with_mkl: ON
with_mkldnn: ON
with_double: OFF
with_python: ON
with_rdma: OFF
with_timer: OFF
需要的话可通过hi联系我提供复现的机器。
既然是预测,其实不太需要两个程序之间有通信。那可以每个进程都用一张卡,把数据在运行之前显示拆分一下。
按楼上的方法跑没有问题
Close it due to solved. Please free feel to reopen this issue if necessary.
请问V2在paddle.infer()的执行方法中,还有batch_size这个概念么? paddle.infer(output_layer=user_features, parameters=parameters, input=input_data, feeding=feeding) 我看demo中只有这些参数,如果需要一次处理多批数据,是把数组传到input_data中。
@HugoLian 可以有,你可以做批量预测,给你找个例子 https://github.com/PaddlePaddle/models/blob/develop/hsigmoid/infer.py#L94