Some of this information can be collected via this script.
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): AWS Sagemaker conda_amazonei_tensorflow2_p36
TensorFlow installed from (source or binary): preinstalled in Sagemaker
TensorFlow version: 2.0.2
Python version: 3.6
bert-as-service version: 1.10.1
GPU model and memory: none
CPU model and memory: ml.t2.medium AWS instance
Description
when starting the server I get some errors, it seems like tensorflow 2.0 has done away with tf.logging.
I:VENTILATOR:[i:i: 67]:freeze, optimize and export graph, could take a while...
E:GRAPHOPT:[gra:opt:154]:fail to optimize the graph!
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/lib/python3.6/site-packages/bert_serving/server/graph.py", line 42, in optimize_graph
tf = import_tf(verbose=args.verbose)
File "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/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 "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/bin/bert-serving-start", line 8, in
sys.exit(main())
File "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/lib/python3.6/site-packages/bert_serving/server/cli/init.py", line 4, in main
with BertServer(get_run_args()) as server:
File "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/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
I'm using this command to start the server:
!bert-serving-start -model_dir /data/wwm_uncased_L-24_H-1024_A-16/ -num_worker=1
Prerequisites
bert-as-service
?README.md
?README.md
?System information
bert-as-service
version: 1.10.1Description
when starting the server I get some errors, it seems like tensorflow 2.0 has done away with tf.logging. I:VENTILATOR:[i:i: 67]:freeze, optimize and export graph, could take a while... E:GRAPHOPT:[gra:opt:154]:fail to optimize the graph! Traceback (most recent call last): File "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/lib/python3.6/site-packages/bert_serving/server/graph.py", line 42, in optimize_graph tf = import_tf(verbose=args.verbose) File "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/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 "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/bin/bert-serving-start", line 8, in
sys.exit(main())
File "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/lib/python3.6/site-packages/bert_serving/server/cli/init.py", line 4, in main
with BertServer(get_run_args()) as server:
File "/home/ec2-user/anaconda3/envs/amazonei_tensorflow2_p36/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
I'm using this command to start the server: !bert-serving-start -model_dir /data/wwm_uncased_L-24_H-1024_A-16/ -num_worker=1
and calling the server via: N/A
Then this issue shows up: