当我在刚刚转换的模型架构上使用 score_batch
时,我遇到了一个 ValueError。我正在使用 score_batch
函数过滤一些翻译数据,以便使用更好的数据继续训练模型。但是,每当该函数在转换后的模型检查点的 Translator 示例上调用时,它都会抛出一个形状错误。x 和 y 似乎根据每个单独的批次而变化,因为当我尝试仅在单个示例上使用 score_batch 时,没有抛出错误。
我已经检查了传入的编码源/目标的结构/值,似乎都处理得很好。传递句子批次为 4096-6048,最大批次大小为 2048 个标记。对于具有相同代码的其他架构模型(没有进行任何更改),此函数的处理工作正常。使用 translate_batch
进行翻译也没有任何问题,所以我不确定发生了什么。
请告诉我是否转换后的模型 / opennmt-py 检查点会有所帮助,或者我可以提供什么帮助。
1条答案
按热度按时间zqdjd7g91#
进行了一些测试,迄今为止只发现它在一次处理一批数据时才能正常工作。
脚本中的max_size似乎也缩短了实际的built_batches,因此在测试中max_size的顺序是递减的。这里是: