jina-ai / clip-as-service

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

TypeError: 'NoneType' object is not iterable #528

Open babai3693 opened 4 years ago

babai3693 commented 4 years ago

env win10 python3.6 bert-serving-client/server 1.9.9 tensorflow 1.13.1 and i got this:

usage: C:\Users\non-admin.conda\envs\textsumm\Scripts\bert-serving-start -model_dir cased_L-12_H-768_A-12/ -num_worker=1 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 = cased_L-12_H-768_A-12/ no_position_embeddings = False no_special_token = False 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:VENTILATOR:freeze, optimize and export graph, could take a while... I:GRAPHOPT:model config: cased_L-12_H-768_A-12/bert_config.json I:GRAPHOPT:checkpoint: cased_L-12_H-768_A-12/bert_model.ckpt E:GRAPHOPT:fail to optimize the graph! Traceback (most recent call last): File "c:\users\non-admin.conda\envs\textsumm\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\non-admin.conda\envs\textsumm\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\non-admin.conda\envs\textsumm\Scripts\bert-serving-start.exe__main.py", line 9, in File "c:\users\non-admin.conda\envs\textsumm\lib\site-packages\bert_serving\server\cli__init__.py", line 4, in main with BertServer(get_run_args()) as server: File "c:\users\non-admin.conda\envs\textsumm\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: 'NoneType' object is not iterable

STHSF commented 4 years ago

model_dir must be the absolute path.

1425998585 commented 4 years ago

if your model's name is bert-base-german-cased rename like this bert-base-german-cased.index bert-base-german-cased.meta bert-base-german-cased.data-00000-of-00001 bert_config.json vocab.txt

Akashdesarda commented 4 years ago

The problem is with TF 2.0. I tested and it work fine on tf 1.15 but not on tf 2.0