jina-ai / clip-as-service

🏄 Scalable embedding, reasoning, ranking for images and sentences with CLIP
https://clip-as-service.jina.ai
Other
12.39k stars 2.07k forks source link

Problems with starting the service #402

Open marcalt94 opened 5 years ago

marcalt94 commented 5 years ago

Prerequisites

Please fill in by replacing [ ] with [x].

System information

Some of this information can be collected via this script.


Description

Hey, I am facing an issue wile trying to start the service using the method described in the readme. I noted that there were two issues having the same problem and error and at first I tried to fix it by using the suggestions they were given, but it didn't work, so I decided to start a new issue.

I downloaded and pip installed bert-as-a-service today, so I should have the most recent version.

When I try to start the service with bert-serving-start -model_dir /uncased_BERT_base/ -num_worker=4 , I get the following error:

usage: C:\Users\marc_\Miniconda3\Scripts\bert-serving-start -model_dir /uncased_BERT_base/ -num_worker=4
                 ARG   VALUE
__________________________________________________
           ckpt_name = bert_model.ckpt
         config_name = bert_config.json
                cors = *
                 cpu = False
          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 = None
        mask_cls_sep = False
      max_batch_size = 256
         max_seq_len = 25
           model_dir = /uncased_BERT_base/
          num_worker = 4
       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:VENTILATOR:freeze, optimize and export graph, could take a while...
I:GRAPHOPT:model config: /uncased_BERT_base/bert_config.json
I:GRAPHOPT:checkpoint: /uncased_BERT_base/bert_model.ckpt
E:GRAPHOPT:fail to optimize the graph!
Traceback (most recent call last):
  File "c:\users\marc_\miniconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\marc_\miniconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\marc_\Miniconda3\Scripts\bert-serving-start.exe\__main__.py", line 9, in <module>
  File "c:\users\marc_\miniconda3\lib\site-packages\bert_serving\server\cli\__init__.py", line 4, in main
    with BertServer(get_run_args()) as server:
  File "c:\users\marc_\miniconda3\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

Does anyone know what to do about this?

chikubee commented 5 years ago

Try giving the absolute path for the model dir and the fine tuned model.

guoyaohua commented 4 years ago

Try giving the absolute path for the model dir and the fine tuned model.

Thanks! It's work.

NidhiRustagi commented 4 years ago

I have tried giving absolute path for the model dir but still giving me same error. What is the fine tuned model? We just download the simple uncase-768 version right?

guoyaohua commented 4 years ago

I have tried giving absolute path for the model dir but still giving me same error. What is the fine tuned model? We just download the simple uncase-768 version right?

No matter which pre-trained model we use, when set absolute path, it works to me.

NidhiRustagi commented 4 years ago

I have tried giving absolute path for the model dir but still giving me same error. What is the fine tuned model? We just download the simple uncase-768 version right?

No matter which pre-trained model we use, when set absolute path, it works to me.

Thanks for a prompt response. So what can I try now to make it work? Will pasting the screenshot help?

sharms3d commented 4 years ago

@chikubee @NidhiRustagi @guoyaohua I am able to run cased bert but am getting the following error when I try to run bio bert, TypeError: 'NoneType' object is not iterable I have tried giving absolute path. OS: Windows biobert_v1.1_pubmed

totopopov commented 4 years ago

@NidhiRustagi
If in any case you are using tensorflow 2, switching to [1.10-1.15] solved the problem for me. OS: Windows

damon91 commented 4 years ago

I can't use TensorFlow 2, because I don't want to change my version of rasa, so I want to solve this with a more appropriate method.