BERT-BiLSTM-CRF-NER icon indicating copy to clipboard operation
BERT-BiLSTM-CRF-NER copied to clipboard

运行服务时出错

Open ZhuoxueQAQ opened this issue 5 years ago • 2 comments

大佬帮我看看QAQ

I:?[33mWORKER-0?[0m:use device gpu: 0, load graph from F:\学习资料\毕设\code\bert-master\bert-master\output\classification_ model.pb WARNING:tensorflow:From d:\anaconda\lib\site-packages\bert_base-0.0.9-py3.7.egg\bert_base\server\helper.py:161: The name tf .logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

WARNING:tensorflow:From d:\anaconda\lib\site-packages\bert_base-0.0.9-py3.7.egg\bert_base\server\helper.py:161: The name tf .logging.ERROR is deprecated. Please use tf.compat.v1.logging.ERROR instead.

Process BertWorker-3: Traceback (most recent call last): File "D:\Anaconda\lib\multiprocessing\process.py", line 297, in bootstrap self.run() File "d:\anaconda\lib\site-packages\bert_base-0.0.9-py3.7.egg\bert_base\server_init.py", line 490, in run self.run() File "d:\anaconda\lib\site-packages\zmq\decorators.py", line 75, in wrapper return func(*args, **kwargs) File "d:\anaconda\lib\site-packages\bert_base-0.0.9-py3.7.egg\bert_base\server\zmq_decor.py", line 27, in wrapper return func(*args, **kwargs) File "d:\anaconda\lib\site-packages\bert_base-0.0.9-py3.7.egg\bert_base\server_init.py", line 508, in _run for r in estimator.predict(input_fn=self.input_fn_builder(receivers, tf), yield_single_examples=False): File "d:\anaconda\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 622, in predict features, None, ModeKeys.PREDICT, self.config) File "d:\anaconda\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1149, in call_model_fn model_fn_results = self.model_fn(features=features, **kwargs) File "d:\anaconda\lib\site-packages\bert_base-0.0.9-py3.7.egg\bert_base\server_init.py", line 466, in classification model_fn pred_probs = tf.import_graph_def(graph_def, name='', input_map=input_map, return_elements=['pred_prob:0']) File "d:\anaconda\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 507, in new_func return func(*args, **kwargs) File "d:\anaconda\lib\site-packages\tensorflow_core\python\framework\importer.py", line 405, in import_graph_def producer_op_list=producer_op_list) File "d:\anaconda\lib\site-packages\tensorflow_core\python\framework\importer.py", line 535, in _import_graph_def_interna l ', '.join(missing_unused_input_keys)) ValueError: Attempted to map inputs that were not found in graph_def: [segment_ids:0]

ZhuoxueQAQ avatar Jan 14 '20 13:01 ZhuoxueQAQ

使用新增的http_service来启动服务。

macanv avatar Feb 28 '20 12:02 macanv

panic with below line , change it to will work well input_map = {"input_ids": input_ids, "input_mask": input_mask} https://github.com/macanv/BERT-BiLSTM-CRF-NER/blob/master/bert_base/server/init.py#L465

bigpigeon avatar Apr 03 '20 07:04 bigpigeon