serving icon indicating copy to clipboard operation
serving copied to clipboard

Error running basic example - 'NoneType' object is not callable in client, exception in Thread-3

Open selimyoussry opened this issue 8 years ago • 4 comments

Hi all,

Specs:

  • Ubuntu 17.04
  • Running Python 3.6.4 (but getting same error with Python 2.7.14)
  • Downloaded the .whl file for tensorflow-serving-api, and pasted it in my virtual environment's site packages, as suggested.

After following the tutorial, the last step (running the mnist_client.py) gives me this:

I run

python mnist_client.py --num_tests=100 --server=localhost:9000

and get

Extracting /tmp/train-images-idx3-ubyte.gz
Extracting /tmp/train-labels-idx1-ubyte.gz
Extracting /tmp/t10k-images-idx3-ubyte.gz
Extracting /tmp/t10k-labels-idx1-ubyte.gz
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/home/selim/.pyenv/versions/3.6.4/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/selim/.pyenv/versions/3.6.4/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/selim/.pyenv/versions/tf-3.6.4/lib/python3.6/site-packages/grpc/_channel.py", line 701, in channel_spin
    completed_call = event.tag(event)
  File "/home/selim/.pyenv/versions/tf-3.6.4/lib/python3.6/site-packages/grpc/_channel.py", line 174, in handle_event
    callback()
  File "/home/selim/.pyenv/versions/tf-3.6.4/lib/python3.6/site-packages/grpc/_channel.py", line 313, in <lambda>
    self._state.callbacks.append(lambda: fn(self))
  File "/home/selim/.pyenv/versions/tf-3.6.4/lib/python3.6/site-packages/grpc/beta/_client_adaptations.py", line 124, in <lambda>
    self._future.add_done_callback(lambda ignored_callback: fn(self))
TypeError: 'NoneType' object is not callable

Please note that:

  • I get the same error even if tensorflow_model_server is not running, so the error probably happens before calling the server
  • In the file mnist_client.py, in the loop for _ in range(num_tests) in the do_inference function has time to do two iterations before the error is thrown.

Any idea?

Thank you very much!

selimyoussry avatar Feb 13 '18 19:02 selimyoussry

same issue,can somebody help?My code is done here

    host,port = FLAGS.server.split(":")
    channel = implementations.insecure_channel(host,int(port))
    stub = prediction_service_pb2.beta_create_PredictionService_stub(channel)
    request = predict_pb2.PredictRequest()
    request.model_spec.name = 'texteditor'
    request.model_spec.signature_name = 'predict_router'
    request.inputs['vectors'].CopyFrom(tf.contrib.util.make_tensor_proto(vectors,shape=[1,vectors.size]))
    result_future = stub.Predict.future(request, 5.0)  # 5 seconds
    result_future.add_done_callback(_create_rpc_callback())

use Python 2.7 tensorflow-serving r1.4 and bazel 0.5.4

txfei avatar Mar 26 '18 03:03 txfei

Try again with the latest (1.10.0) - we've moved away from gRPC beta.

gautamvasudevan avatar Aug 15 '18 19:08 gautamvasudevan

@selimyoussry - Hi, does this issue persists with the latest version ? If not, feel free to close this. Thanks !

Harshini-Gadige avatar Oct 25 '18 17:10 Harshini-Gadige

Closing due to lack of activity.

Harshini-Gadige avatar Dec 03 '18 23:12 Harshini-Gadige