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 #489

Open HeziLiu opened 4 years ago

HeziLiu commented 4 years ago

env win10 python3.6 bert-serving-client/server 1.9.7 tensorflow 1.14.0 and i got this: E:\Software\Python3.6.5\Scripts>bert-serving-start -model_dir ./uncased_L-12_H-768_A-12/ -num_worker=4 usage: E:\Software\Python3.6.5\Scripts\bert-serving-start -model_dir ./uncased_L-12_H-768_A-12/ -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_L-12_H-768_A-12/ no_special_token = False 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... WARNING:tensorflow:From e:\software\python3.6.5\lib\site-packages\bert_serving\server\helper.py:184: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

WARNING:tensorflow:From e:\software\python3.6.5\lib\site-packages\bert_serving\server\helper.py:184: The name tf.logging.ERROR is deprecated. Please use tf.compat.v1.logging.ERROR instead.

I:GRAPHOPT:model config: ./uncased_L-12_H-768_A-12/bert_config.json I:GRAPHOPT:checkpoint: ./uncased_L-12_H-768_A-12/bert_model.ckpt I:GRAPHOPT:build graph... E:GRAPHOPT:fail to optimize the graph! Traceback (most recent call last): File "e:\software\python3.6.5\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "e:\software\python3.6.5\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "E:\Software\Python3.6.5\Scripts\bert-serving-start.exe__main.py", line 9, in File "e:\software\python3.6.5\lib\site-packages\bert_serving\server\cli__init__.py", line 4, in main with BertServer(get_run_args()) as server: **File "e:\software\python3.6.5\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**

aszhanghuali commented 4 years ago

I have the same question!Have you solved it?

sivakumarch commented 4 years ago

Facing the same issue when I tried to start the server, here is the stacktrace - looks like issue related to tensorflow 2.0 updates. Please let us know if this will be addressed soon.

I:VENTILATOR:[i:i: 67]:freeze, optimize and export graph, could take a while... E:GRAPHOPT:[gra:opt:151]:fail to optimize the graph! Traceback (most recent call last): File "skc/environments/.virtualenvs/bert/lib/python3.6/site-packages/bert_serving/server/graph.py", line 41, in optimize_graph tf = import_tf(verbose=args.verbose) File "/environments/.virtualenvs/bert/lib/python3.6/site-packages/bert_serving/server/helper.py", line 186, in import_tf tf.logging.set_verbosity(tf.logging.DEBUG if verbose else tf.logging.ERROR) AttributeError: module 'tensorflow' has no attribute 'logging' Traceback (most recent call last): File "/environments/.virtualenvs/bert/bin/bert-serving-start", line 8, in sys.exit(main()) File "/environments/.virtualenvs/bert/lib/python3.6/site-packages/bert_serving/server/cli/init.py", line 4, in main with BertServer(get_run_args()) as server: File "/home/imagen/skc/environments/.virtualenvs/bert/lib/python3.6/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 $ bert-serving-start -model_dir /bert/bert-models/cased_L-12_H-768_A-12/ -num_worker=1 /home/imagen/skc/environments/.virtualenvs/bert/lib/python3.6/site-packages/bert_serving/server/helper.py:176: UserWarning: Tensorflow 2.0.0 is not tested! It may or may not work. Feel free to submit an issue at https://github.com/hanxiao/bert-as-service/issues/ 'Feel free to submit an issue at https://github.com/hanxiao/bert-as-service/issues/' % tf.version)

sivakumarch commented 4 years ago

sorry - downgrading to tensorflow 1.x worked, it was due to 2.0 updates. I tried to upgrade the bert_serving scripts using 2.0 tools, but I wasn't successful as there were some errors.

HeziLiu commented 4 years ago

I have the same question!Have you solved it?

I change to another env with
tensorflow 1.13.1 bert-serving-client/server 1.9.9 python3.7 and it works well😀

HeziLiu commented 4 years ago

sorry - downgrading to tensorflow 1.x worked, it was due to 2.0 updates. I tried to upgrade the bert_serving scripts using 2.0 tools, but I wasn't successful as there were some errors.

but with my env with tensorflow 1.14.0 it seems doesn't work....

ginward commented 4 years ago

downgrading to tensorflow version 1.15 seems to work for me

nonononanana commented 4 years ago

check the path of the downloaded model.

AsmaZbt commented 4 years ago

I have the same question!Have you solved it?

I change to another env with tensorflow 1.13.1 bert-serving-client/server 1.9.9 python3.7 and it works well😀

thank you so much , finally it work for me !

sprite0153 commented 4 years ago

I meet that issue to..but I don't want to downgrading,Is there have any other settlement work for 2.0

harshitbh commented 3 years ago

I am still facing the above issue have tried couple of solutions. Version - tensorflow-cpu = 1.13.1 Bert_serving_client = 1.9.9 Bert_serving_server = 1.9.9

harshitbh commented 3 years ago

I am running the below command after locating at model_dir command bert-serving-start -model_dir uncased_L-2_H-128_A-2\ -cpu files present in model_dir :bert_config.json,bert_model.ckpt.data-00000-of-00001,bert_model.ckpt.index,vocab.txt have tried with providing absolute path till model directory too system config - 12 gb ram. let me know how could I resolve this.Thanks in advance

Jaswanth-Batturi commented 3 years ago

I am getting the same problem in windows, although I tried all the methods. "TypeError: 'NoneType' object is not iterable". Please somebody help me.

wingzzzz commented 3 years ago

你们模型目录写错啦

Doracoco commented 3 years ago

你们模型目录写错啦 那应该怎么写呢,没有发现哪里写错了

wingzzzz commented 3 years ago

你们模型目录写错啦 那应该怎么写呢,没有发现哪里写错了

你试试绝对路径

Doracoco commented 3 years ago

你们模型目录写错啦 那应该怎么写呢,没有发现哪里写错了

你试试绝对路径

还是不行的,我的绝对路径还是不行,不过还是谢谢你啦

nonononanana commented 3 years ago

加速 入关

wingzzzz commented 3 years ago

你们模型目录写错啦 那应该怎么写呢,没有发现哪里写错了

你试试绝对路径

还是不行的,我的绝对路径还是不行,不过还是谢谢你啦

有可能是tensorflow版本过高,api不兼容,只支持1.x.x版本的。报错信息跟进去,可以看到源码,大于1的版本会报一个未测试验证的警告。

dogrepairditch commented 2 years ago

你们模型目录写错啦 那应该怎么写呢,没有发现哪里写错了

你最后怎么弄的呀 我要崩溃了

Doracoco commented 2 years ago

您好,我已经收到您的邮件,我将尽快处理。                                                                                                --胡思可