ModelArts上多机多卡运行GPT2-13B时报错Inconsistent batch shapes, batch operation expects same shape for each data row
2024/02/22
227
问题信息
问题来源 | 产品大类 | 产品子类 | 关键字 |
---|---|---|---|
官方 | 模型训练 | MindSpore | ModelArts多机多卡、Inconsistent batch shapes |
问题现象描述
ModelArts上多机多卡运行GPT2-13B时报错RuntimeError: Unexpected error. Inconsistent batch shapes, batch operation expects same shape for each data row, but got inconsistent shape in column 0, expected shape for this column is:<1025>, got shape:<1024>
开源代码路径:https://gitee.com/mindspore/mindformers/tree/dev
原因分析
可能是训练数据集制作是shape不匹配。
可能是数据集路径未传正确。
排查方法
1. 按照文档重新制作数据集,确定训练数据处理时,长度应等于模型接收长度加一,再加载数据看是否报错;
2. 确定train数据集路径指定是否正确;
解决措施
本地可指定train文件路径,但ModelArts上需指定train数据集目录;