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

我的是英文NER的BERT模型,东西大同小异,但是我在用freeze_.graph.py的时候出现了如下问题,想请教下您会吗 #21

Open
zwd13122889 opened this issue Apr 8, 2020 · 2 comments

Comments

@zwd13122889
Copy link

tensorflow.python.framework.errors_impl.NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Key output_bias not found in checkpoint
[[node save/RestoreV2 (defined at freeze_graph.py:191) = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
[[{{node save/RestoreV2/_393}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_397_save/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]

然后我打开了checkpoint的文件,文件如下:
model_checkpoint_path: "model.ckpt-1136"
all_model_checkpoint_paths: "model.ckpt-0"
all_model_checkpoint_paths: "model.ckpt-1000"
all_model_checkpoint_paths: "model.ckpt-1136"

这边有什么问题吗
他说偏置没找到,不应该在ckpt里面吗?

@zwd13122889
Copy link
Author

我再次查看了一下报错,如下:
Key output_bias not found in checkpoint

看了一些网上的debug方法,是不是我那个BERT的模型输出 output_bias 不叫这个名字啊?
如果是这样的话,我该如何解决

@zwd13122889
Copy link
Author

zwd13122889 commented Apr 8, 2020

我打印了一下ckpt里面的变量名,如下:
image
di'que
的确是没有所谓的output_bias,我想知道我改把那个的名称改成 output_bias 呢

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