错误:
(myenv) F:\作业\软件架构\机器学习\实验\实验26-2-使用bert构建词向量\chinese_bert_wwm_L-12_H-768_A-12>bert-serving-start -model_dir ./publish/ -num_worker=1
usage: E:\soft\anoconda\envs\myenv\Scripts\bert-serving-start -model_dir ./publish/ -num_worker=1
I:[36mGRAPHOPT[0m:model config: ./publish/bert_config.json
I:[36mGRAPHOPT[0m:checkpoint: ./publish/bert_model.ckpt
I:[36mGRAPHOPT[0m:build graph...
E:[36mGRAPHOPT[0m:fail to optimize the graph!
Traceback (most recent call last):
File "E:\soft\anoconda\envs\myenv\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "E:\soft\anoconda\envs\myenv\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "E:\soft\anoconda\envs\myenv\Scripts\bert-serving-start.exe\__main__.py", line 7, in <module>
File "E:\soft\anoconda\envs\myenv\lib\site-packages\bert_serving\server\cli\__init__.py", line 4, in main
with BertServer(get_run_args()) as server:
File "E:\soft\anoconda\envs\myenv\lib\site-packages\bert_serving\server\__init__.py", line 71, in __init__
self.graph_path, self.bert_config = pool.apply(optimize_graph, (self.args,))
TypeError: cannot unpack non-iterable NoneType object
我的tensorflow版本是1.15.0,python3.7运行报错,
解决方法:anaconda环境,创建python3.6,安装tensorflow版本为1.10.0
下载对应的模型文件,确保路径写正确,应该是 bert-serving-start -model_dir ./publish/ -num_worker=1
一开始下载完模型后,解压之后直接用的
bert-serving-start -model_dir ./chinese_wwm_ext_L-12_H-768_A-12/ -num_work ,并没有发现解压完后里面有一层publish目录,所以报错找不到模型,
要确保模型的路径下就是模型文件
标签:__,bert,serving,启动,envs,myenv,报错,soft From: https://www.cnblogs.com/yhkdw/p/18194692