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: 3.6VGA compatible controller [0300]: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] [10de:1b06] (rev a1) (prog-if 00 [VGA controller])
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 YOUR_SERVER_ARGS
and calling the server via:
bc = BertClient(YOUR_CLIENT_ARGS)
bc.encode()
Then this issue shows up:
E:GRAPHOPT:[gra:opt:150]:fail to optimize the graph!
Traceback (most recent call last):
File "/home/sgnbx/anaconda3/envs/py3/lib/python3.5/site-packages/bert_serving/server/graph.py", line 57, in optimize_graph
bert_config = modeling.BertConfig.from_dict(json.load(f))
File "/home/sgnbx/anaconda3/envs/py3/lib/python3.5/json/__init__.py", line 265, in load
return loads(fp.read(),
File "/home/sgnbx/anaconda3/envs/py3/lib/python3.5/site-packages/tensorflow/python/lib/io/file_io.py", line 125, in read
self._preread_check()
File "/home/sgnbx/anaconda3/envs/py3/lib/python3.5/site-packages/tensorflow/python/lib/io/file_io.py", line 85, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File "/home/sgnbx/anaconda3/envs/py3/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 519, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /tmp/english_L-12_H-768_A-12/bert_config.json; No such file or directory
Traceback (most recent call last):
File "/home/sgnbx/anaconda3/envs/py3/bin/bert-serving-start", line 11, in <module>
sys.exit(main())
File "/home/sgnbx/anaconda3/envs/py3/lib/python3.5/site-packages/bert_serving/server/cli/__init__.py", line 4, in main
with BertServer(get_run_args()) as server:
File "/home/sgnbx/anaconda3/envs/py3/lib/python3.5/site-packages/bert_serving/server/__init__.py", line 70, in __init__
self.graph_path, self.bert_config = pool.apply(optimize_graph, (self.args,))
TypeError: 'NoneType' object is not iterable
...
Hi @sariagoudarzvand as mentioned in your error log, tensorflow can't find your bert_config file. Can you make sure that it is at intended path and rerun again and see if it still throws the error.
tensorflow.python.framework.errors_impl.NotFoundError: /tmp/english_L-12_H-768_A-12/bert_config.json; No such file or directory
Traceback (most recent call last):
Hi, I notice one thing.
change the _PATH_ '/tmp/english_L-12_H-768_A-12/' to 'tmp/english_L-12_H-768_A-12/' or './tmp/english_L-12_H-768_A-12/' works well for me.
You might try.
Hi, I notice one thing.
change the _PATH_ '/tmp/english_L-12_H-768_A-12/' to 'tmp/english_L-12_H-768_A-12/' or './tmp/english_L-12_H-768_A-12/' works well for me.
You might try.
Thank you very much! It works for my code.
Most helpful comment
Hi, I notice one thing.
change the _PATH_ '/tmp/english_L-12_H-768_A-12/' to 'tmp/english_L-12_H-768_A-12/' or './tmp/english_L-12_H-768_A-12/' works well for me.
You might try.