PaddlePaddle / Knover

Large-scale open domain KNOwledge grounded conVERsation system based on PaddlePaddle
Apache License 2.0
674 stars 131 forks source link

InvalidArgumentError: Broadcast dimension mismatch #173

Open what-is-perfect opened 1 year ago

what-is-perfect commented 1 year ago

您好,我使用Knover训练了一个Plato2模型,但在使用hub serving start部署到我的后台后,使用jmeter测试,jmeter客户端报错。 报错内容如下: InvalidArgumentError: Broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [20, 16, 20, 27] and the shape of Y = [20, 16, 1, 8]. Received [27] in X is not equal to [8] in Y at i:3. [Hint: Expected x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1 == true, but received x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1:0 != true:1.] (at /paddle/paddle/phi/kernels/funcs/common_shape.h:84) [operator < elementwise_add > error]","results":"","status":"101"} 我的环境如下: 服务部署平台:paddlepaddle-gpu容器。容器版本:paddlepaddle/paddle 2.3.2-gpu-cuda11.2-cudnn8 Knover版本:0.0.6 GPU数量:1 paddlehub版本:2.3.0 我完成了以下方案的测试: 1、export CUDA_VISIBLE_DEVICES=0 2、因为本地运行interact.py对应脚本成功,因此我将AIstudio上一位开发者的开源项目中的module.py中关于数据加载的部分按照Knover/knover/core/model.py中对应的部分重写了一次,但仍然报错。对比两步骤发现:本地调用时,将数据转换为tensor的部分shape恒定为20,但hub部署的服务过程中的tensor的shape会随着文本分词后的长度而变化。我不太清楚应该修改哪个部分,请问是否有这方面的方案,或者在该版本下的plato2_en_base的部署教程啊? 2中的开源作者的AIStudio的链接为:https://aistudio.baidu.com/aistudio/projectdetail/1197592 谢谢

what-is-perfect commented 1 year ago

上面的开源项目的开发者的开发环境为paddlehub1.8.4,paddlepaddle1.8.3,不太清楚是否使用了容器

sserdoubleh commented 1 year ago

我看了下,根据project下面的评论 https://aistudio.baidu.com/aistudio/projectdetail/1197592 应该是因为 Paddlehub的版本太高了,可以尝试下paddlehub<2.0的版本使用哈,可以用开发者的开发环境的版本:1.8.4 可以尝试重装一下paddlehub