Comments (3)
请检查设置的环境变量值是否正确:
$TRAINED_CLASSIFIER
$EXP_NAME
请参考readme.md中的说明,指定对应的环境变量,或者直接写出模型文件的目录名称;
from bert-train2deploy.
我试了一下改了环境变量,故意输错
E:NER_MODEL, Lodding...:[gra:opt:306]:fail to optimize the graph! /work/dl/pretrained-model/chinese_L-12_H-768_A-12/1/bert_config.json; No such file or directory
FileNotFoundError: [Errno 2] No such file or directory: '/work/dl/BERT-train2deploy/output/certificate1/label2id.pkl'
报的错和前面的不同
from bert-train2deploy.
找到原因了
由于我需要运行的是ner模式,看了下bert_base/server/graph.py的源码
# 如果PB文件已经存在则,返回PB文件的路径,否则将模型转化为PB文件,并且返回存储PB文件的路径
if args.model_pb_dir is None:
# 获取当前的运行路径
tmp_file = os.path.join(os.getcwd(), 'predict_optimizer')
if not os.path.exists(tmp_file):
os.mkdir(tmp_file)
else:
tmp_file = args.model_pb_dir
pb_file = os.path.join(tmp_file, 'ner_model.pb')
if os.path.exists(pb_file):
print('pb_file exits', pb_file)
return pb_file
NER的PD文件默认名称是 ner_model.pb
把freeze_graph.py
pb_file = os.path.join(tmp_dir, 'classification_model.pb')
改成
pb_file = os.path.join(tmp_dir, 'ner_model.pb')
或者仿造 optimize_class_model 方法 加一个 optimize_ner_model
服务就可以跑起来了
from bert-train2deploy.
Related Issues (20)
- 请假一下,如何显示各个类别的分类质量比如f1score等
- 请问下怎么设置CPU部署
- 如何利用训练好的bert模型处理句对相似度的任务 HOT 2
- freeze_graph.py的问题2 HOT 4
- 评测代码是有问题的 HOT 2
- ImportError: No module named six HOT 1
- 运行bert_base_serving_start时出错 HOT 4
- 请问,如果想输出每个标签对应的score,应该怎么修改呢 HOT 2
- 我的是英文NER的BERT模型,东西大同小异,但是我在用freeze_.graph.py的时候出现了如下问题,想请教下您会吗 HOT 2
- 这个方法有啥用
- label2id文件训练时没有生成,是否需要重新训练 HOT 1
- 同一机器开启多个服务时卡住
- 预测很慢
- 模型服务端部署完成之后,通过调用端口进行测试,发现项目下面生成了很多tmp文件夹,有什么方法不生成吗 HOT 2
- 您好,生成的label2id 文件为什么是空的
- 服务端接受数据后无处理结果反馈 HOT 1
- 服务端接收请求后无响应
- 使用TensorFlow-gpu会报错,但使用TensorFlow-cpu不会
- 为什么预测的时候加载的不是训练后的模型,而是加载的bert_model.ckpt呢
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bert-train2deploy.