Vespa文档示例部署失败,max_sim函数张量维度不匹配求助
Vespa部署失败:张量维度不匹配错误解决
错误详情
RuntimeError: Deployment failed, code: 400, message: {'error-code': 'INVALID_APPLICATION_PACKAGE', 'message': "Invalid application: In schema 'testapp', rank profile 'combined_ranking': The function 'context_max_sim' is invalid: max_sim is invalid: Can not join tensor(qt{},x[128]) and tensor(context{},dt{},x[16]): Unequal dimension x in tensor(qt{},x[128]) and tensor(context{},dt{},x[16])"}
问题原因
错误核心是张量维度不匹配:在combined_ranking排序配置文件的context_max_sim函数中,max_sim操作需要连接两个张量,但tensor(qt{},x[128])的x维度为128,而tensor(context{},dt{},x[16])的x维度为16,维度大小不一致导致无法执行连接操作。
解决步骤
- 检查schema中两个张量的
x维度定义,确保二者维度大小一致:要么将tensor(qt{},x[128])的x维度调整为16,要么将tensor(context{},dt{},x[16])的x维度调整为128。 - 对照Vespa官方示例的配置,确认是否在复现过程中误修改了张量维度参数,修正为与示例一致的配置。
- 检查
context_max_sim函数内max_sim操作的传入参数,确保参与运算的张量在连接维度上完全匹配。
内容的提问来源于stack exchange,提问作者DVS
相关产品推荐
相关产品推荐

