jina-ai / clip-as-service

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

BertClient object not being returned in simple demo #466

Open EvanZ opened 4 years ago

EvanZ 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

Please replace YOUR_SERVER_ARGS and YOUR_CLIENT_ARGS accordingly. 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 Downloads/uncased_L-12_H-768_A-12/ -num_worker=4

and calling the server via:

bc = BertClient(ip='localhost')
bc.encode()

Then this issue shows up:

Python console hangs after bc = BertClient(ip='localhost'):

~ via bert
➔ python
Python 3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from bert_serving.client import BertClient
>>> bc = BertClient(ip='localhost')

...

alelasantillan commented 4 years ago

Same problem here. The bert-as-service is running in one terminal window showing:

I:GRAPHOPT:[gra:opt:128]:load parameters from checkpoint... I:GRAPHOPT:[gra:opt:132]:optimize... I:GRAPHOPT:[gra:opt:140]:freeze... I:GRAPHOPT:[gra:opt:145]:write graph to a tmp file: /tmp/tmpyog8r74t I:VENTILATOR:[i:i: 75]:optimized graph is stored at: /tmp/tmpyog8r74t I:VENTILATOR:[i:_ru:129]:bind all sockets I:VENTILATOR:[__i:_ru:133]:open 8 ventilator-worker sockets I:VENTILATOR:[i:_ru:136]:start the sink I:SINK:[i:_ru:306]:ready I:VENTILATOR:[__i:_ge:222]:get devices W:VENTILATOR:[i:_ge:246]:no GPU available, fall back to CPU I:VENTILATOR:[i:_ge:255]:device map: worker 0 -> cpu worker 1 -> cpu worker 2 -> cpu worker 3 -> cpu I:WORKER-0:[__i:_ru:531]:use device cpu, load graph from /tmp/tmpyog8r74t I:WORKER-1:[i:_ru:531]:use device cpu, load graph from /tmp/tmpyog8r74t I:WORKER-2:[__i:_ru:531]:use device cpu, load graph from /tmp/tmpyog8r74t I:WORKER-3:[__i:_ru:531]:use device cpu, load graph from /tmp/tmpyog8r74t

And on another terminal window I run: python Python 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

from bert_serving.client import BertClient bc = BertClient()

And got stuck there. Any idea what's going on?

PS: I don't have a GPU working with CUDA.

igorms-pro commented 4 years ago

same [EDIT] I tested with a GPU (under Google Notebook) and it is working now!

alelasantillan commented 4 years ago

In my case it seems to be something in the ubuntu anaconda docker image I am using. I've tried exactly the same in my mac osx and it worked like a charm using CPU.

zhsuiy commented 4 years ago

Same here. Tried binding different port_in and port_out, not working.