使用inference_model进行多卡预测人脸检测,ParallelExecutor无法正确合并多卡上的detection_output的输出
Created by: wang-kangkang
使用inference_model进行多卡预测人脸检测,报错内容: Recommended issue content: all error stack information [Hint: Expected framework::product(new_dim) / new_dim[0] == framework::product(t->dims()) / t->dims()[0], but received framework::product(new_dim) / new_dim[0]:6 != framework::product(t->dims()) / t->dims()[0]:1.] at (/paddle/paddle/fluid/framework/lod_tensor.cc:396)
a、原因推测:使用inference_model进行多卡预测人脸检测,卡数==batchsize==8,当一张图的detection_output输出里没有任何输出,会导致其维度为0,此时其他卡的输出维度为[1, 6] [4, 6]这种,推测为ParallelExecutor无法正确合并多卡上的detection_output的输出。 b、还有另一个问题,当我的设置为卡数==8, batchsize==32*8时,无检测结果的时候,detection_output的输出维度是[0, 6],此时就又不会出现上面的问题了
复现代码找我:wangkangkang@baidu.com 环境:python -V Python 3.6.3 :: Anaconda, Inc. pip list | grep paddle paddlepaddle-gpu (1.7.0.post97) CUDA Capability: 61, Driver API Version: 10.2, Runtime API Version: 9.0 cuDNN Version: 7.0