1

这是我第一次使用 Tensorflow 和 Bert-as-service。使用 VS 代码作为编辑器,我无法启动 Bert-as-service 服务器端。同时,位于 Jupyter Notebook 上的 Bert-as-service 客户端也失败了,如下图所示。

我只想启动 BERT 服务并使用客户端获取句子编码,如此处的示例。请帮我。

环境:Windows 7 RAM 4G/Anaconda 2019.07/Python 3.7.3/tensorflow 1.14/Bert-as-Service CPU 版本

(base) C:\Users\lee>bert-serving-start -model_dir E:/MyDownloads/uncased_L-12_H-768_A-12 -cpu -http_port 80 -max_seq_len 20
usage: D:\MyPrograms\Anaconda\Scripts\bert-serving-start -model_dir E:/MyDownloads/uncased_L-12_H-768_A-12 -cpu -http_port 80 -max_seq_len 20
                 ARG   VALUE
__________________________________________________
           ckpt_name = bert_model.ckpt
         config_name = bert_config.json
                cors = *
                 cpu = True
          device_map = []
       do_lower_case = True
  fixed_embed_length = False
                fp16 = False
 gpu_memory_fraction = 0.5
       graph_tmp_dir = None
    http_max_connect = 10
           http_port = 80
        mask_cls_sep = False
      max_batch_size = 256
         max_seq_len = 20
           model_dir = E:/MyDownloads/uncased_L-12_H-768_A-12
          num_worker = 1
       pooling_layer = [-2]
    pooling_strategy = REDUCE_MEAN
                port = 5555
            port_out = 5556
       prefetch_size = 10
 priority_batch_size = 16
show_tokens_to_client = False
     tuned_model_dir = None
             verbose = False
                 xla = False

I:?[35mVENTILATOR?[0m:freeze, optimize and export graph, could take a while...
WARNING:tensorflow:From d:\myprograms\anaconda\lib\site-packages\bert_serving\server\helper.py:180: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

WARNING:tensorflow:From d:\myprograms\anaconda\lib\site-packages\bert_serving\server\helper.py:180: The name tf.logging.ERROR is deprecated. Please use tf.compat.v1.logging.ERROR instead.

I:?[36mGRAPHOPT?[0m:model config: E:/MyDownloads/uncased_L-12_H-768_A-12\bert_config.json
I:?[36mGRAPHOPT?[0m:checkpoint: E:/MyDownloads/uncased_L-12_H-768_A-12\bert_model.ckpt
(Then it stopped here and nothing happened that seemed to clash.)

在此处输入图像描述

4

0 回答 0