-
Notifications
You must be signed in to change notification settings - Fork 166
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
关于压缩pb #3
Comments
这个modeling就是BERT的源码,请到 https://github.com/google-research/bert |
modeling.py文件已经补充更新。 |
后续在python freeze_graph的过程中设置num——labels后 E:CLASSIFICATION_MODEL, Lodding...:[fre:opt:200]:fail to optimize the graph! local variable 'num_labels' referenced before assignment |
如果num——labels使用默认则会出现 |
是label2id.pkl的路径?但是在参数里也无法进行设置啊难道是直接在函数里面改吗 |
未指定num_labels参数时报错的bug已经处理,会从model_dir目录下的”label2id.pkl"文件读取 |
NotFoundError (see above for traceback): 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 Key output_bias 具体是指什么找不到呢 |
检查下各个参数是否指定正确:
|
错误疑似发生在对于预训练模型的识别上,我直接选定的是原有的含config.json、vocab.txt等5个文件的那个目录(我把那个chinese_L-12_H-768_A-12的5个文件放入一个叫做checkpoint的目录下)然后好像就会报如下的错误:2019-05-24 15:07:48.180114: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Not found: Key output_bias not found in checkpoint Key output_bias not found in checkpoint Caused by op 'save/RestoreV2', defined at: NotFoundError (see above for traceback): 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 During handling of the above exception, another exception occurred: Traceback (most recent call last): Caused by op 'save/RestoreV2', defined at: NotFoundError (see above for traceback): Key output_bias not found in checkpoint During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Key output_bias not found in checkpoint Caused by op 'save/RestoreV2', defined at: NotFoundError (see above for traceback): 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 |
是不是freeze.graph 第193行那个路径是不是应该是bert-model_dir预训练模型路径?而不是model_dir(output_dir) |
既然用了freeze_graph,把tensorflow的optimize_for_inference也用一下吧 |
@tian231825 我遇到了和你一样的问题,请问您最后是怎么解决的呢 |
您好,在freeze_graph那一步中,您的line17 使用了import modeling,请问这个是项目提供的吗?为什么一直报找不到modeling
The text was updated successfully, but these errors were encountered: