Prerequisites
Please fill in by replacing
[ ]with[x].
bert-as-service?README.md?README.md?System information
Some of this information can be collected via this script.
bert-as-service version: the latest version;Please replace
YOUR_SERVER_ARGSandYOUR_CLIENT_ARGSaccordingly. You can also write your own description for reproducing the issue.
I'm using this command to start the server:
bert-serving-start -model_dir /BERT/uncased_L-24_H-1024_A-16 -num_worker=1
bert-serving-start YOUR_SERVER_ARGS
2020-06-10 11:03:25.838138: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
usage: C:UsersFanyi MoAppDataLocalProgramsPythonPython35Scriptsbert-serving-start -model_dir /BERT/uncased_L-24_H-1024_A-16 -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 = /BERT/uncased_L-24_H-1024_A-16
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
Then this issue shows up:
I:[35mVENTILATOR[0m:freeze, optimize and export graph, could take a while...
2020-06-10 11:03:30.497862: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
WARNING:tensorflow:From c:usersfanyi moappdatalocalprogramspythonpython35libsite-packagesbert_servingserverhelper.py:186: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.
WARNING:tensorflow:From c:usersfanyi moappdatalocalprogramspythonpython35libsite-packagesbert_servingserverhelper.py:186: The name tf.logging.ERROR is deprecated. Please use tf.compat.v1.logging.ERROR instead.
I:[36mGRAPHOPT[0m:model config: /BERT/uncased_L-24_H-1024_A-16bert_config.json
I:[36mGRAPHOPT[0m:checkpoint: /BERT/uncased_L-24_H-1024_A-16bert_model.ckpt
E:[36mGRAPHOPT[0m:fail to optimize the graph!
Traceback (most recent call last):
File "c:usersfanyi moappdatalocalprogramspythonpython35librunpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:usersfanyi moappdatalocalprogramspythonpython35librunpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:UsersFanyi MoAppDataLocalProgramsPythonPython35Scriptsbert-serving-start.exe__main__.py", line 7, in
File "c:usersfanyi moappdatalocalprogramspythonpython35libsite-packagesbert_servingservercli__init__.py", line 4, in main
with BertServer(get_run_args()) as server:
File "c:usersfanyi moappdatalocalprogramspythonpython35libsite-packagesbert_servingserver__init__.py", line 71, in __init__
self.graph_path, self.bert_config = pool.apply(optimize_graph, (self.args,))
TypeError: 'NoneType' object is not iterable
...
i met the same question, how to solve it
I have the same problem and have tried numerous different model paths to no success
Prerequisites
Please fill in by replacing
[ ]with[x].
- [x ] Are you running the latest
bert-as-service?- [x ] Did you follow the installation and the usage instructions in
README.md?- [x ] Did you check the FAQ list in
README.md?- [ x] Did you perform a cursory search on existing issues?
System information
Some of this information can be collected via this script.
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): win10
- TensorFlow installed from (source or binary): I typed this in command window to install: pip3 install tensorflow-gpu==1.15
- TensorFlow version: 1.15
- Python version: 3.5
bert-as-serviceversion: the latest version;
I typed this in command window to install: pip3 install -U bert-serving-server bert-serving-client- GPU model and memory:
- CPU model and memory:
Description
Please replace
YOUR_SERVER_ARGSandYOUR_CLIENT_ARGSaccordingly. You can also write your own description for reproducing the issue.I'm using this command to start the server:
bert-serving-start -model_dir /BERT/uncased_L-24_H-1024_A-16 -num_worker=1bert-serving-start YOUR_SERVER_ARGS2020-06-10 11:03:25.838138: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
usage: C:UsersFanyi MoAppDataLocalProgramsPythonPython35Scriptsbert-serving-start -model_dir /BERT/uncased_L-24_H-1024_A-16 -num_worker=1
ARG VALUEckpt_name = bert_model.ckpt config_name = bert_config.json cors = * cpu = False device_map = [] do_lower_case = Truefixed_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 = /BERT/uncased_L-24_H-1024_A-16
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 = FalseThen this issue shows up:
I:锟絒35mVENTILATOR锟絒0m:freeze, optimize and export graph, could take a while...
2020-06-10 11:03:30.497862: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
WARNING:tensorflow:From c:usersfanyi moappdatalocalprogramspythonpython35libsite-packagesbert_servingserverhelper.py:186: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.WARNING:tensorflow:From c:usersfanyi moappdatalocalprogramspythonpython35libsite-packagesbert_servingserverhelper.py:186: The name tf.logging.ERROR is deprecated. Please use tf.compat.v1.logging.ERROR instead.
I:锟絒36mGRAPHOPT锟絒0m:model config: /BERT/uncased_L-24_H-1024_A-16bert_config.json
I:锟絒36mGRAPHOPT锟絒0m:checkpoint: /BERT/uncased_L-24_H-1024_A-16bert_model.ckpt
E:锟絒36mGRAPHOPT锟絒0m:fail to optimize the graph!
Traceback (most recent call last):
File "c:usersfanyi moappdatalocalprogramspythonpython35librunpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:usersfanyi moappdatalocalprogramspythonpython35librunpy.py", line 85, in _run_code exec(code, run_globals) File "C:UsersFanyi MoAppDataLocalProgramsPythonPython35Scriptsbert-serving-start.exe__main__.py", line 7, in File "c:usersfanyi moappdatalocalprogramspythonpython35libsite-packagesbert_servingservercli__init__.py", line 4, in main
with BertServer(get_run_args()) as server:
File "c:usersfanyi moappdatalocalprogramspythonpython35libsite-packagesbert_servingserver__init__.py", line 71, in init
self.graph_path, self.bert_config = pool.apply(optimize_graph, (self.args,))
TypeError: 'NoneType' object is not iterable
...
perhaps you could check whether your model_dir path is correct.
Most helpful comment
i met the same question, how to solve it