jina-ai / clip-as-service

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

Tensorflow 2.0 AttributeError: module 'tensorflow' has no attribute 'logging' #566

Open MaxNiebergall opened 4 years ago

MaxNiebergall commented 4 years ago

Prerequisites

Please fill in by replacing [ ] with [x].

System information

Some of this information can be collected via this script.


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

and calling the server via: N/A

Then this issue shows up:

image

francisjervis commented 4 years ago

Same issue, trying to run the run_bert_service.sh script in this project throws the same error. https://github.com/nghuyong/rasa-faq-bot

francisjervis commented 4 years ago

This is apparently fixed in #549