Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

训练完毕进行预测时,遇到检查点不匹配的报错 #11

Open
hanyimei opened this issue Jul 5, 2024 · 1 comment
Open

Comments

@hanyimei
Copy link

hanyimei commented Jul 5, 2024

使用自己的训练数据集进行模型训练,在bert_ner_api.py的main函数中选择use_train = False进行预测时,报错:
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [10] rhs shape= [11]
但我并无修改代码中任何位置

@hanyimei
Copy link
Author

hanyimei commented Jul 5, 2024

这个错误表明在恢复检查点时,TensorFlow 发现当前模型的张量形状与检查点中的张量形状不匹配。具体来说,左侧张量的形状是 [10],而右侧张量的形状是 [11]。这通常是由于模型定义与保存的检查点不匹配导致的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant