tensorflow_serving/example/mnist_client.py
def _callback(result_future):
    """Callback function.

    Calculates the statistics for the prediction result.

    Args:
      result_future: Result future of the RPC.
    """
    exception = result_future.exception()
    if exception:
      result_counter.inc_error()
      print(exception)
    else:
      sys.stdout.write('.')
      sys.stdout.flush()
      response = numpy.array(
          result_future.result().outputs['scores'].float_val)
      prediction = numpy.argmax(response)
      if label != prediction:
        result_counter.inc_error()
    result_counter.inc_done()
    result_counter.dec_active()
Callback function.

    Calculates the statistics for the prediction result.

    Args:
      result_future: Result future of the RPC.
    
Callback function.
Calculates the statistics for the prediction result.
Callback function . Calculates the statistics for the prediction result .
def _callback(result_future):
    exception = result_future.exception()
    if exception:
      result_counter.inc_error()
      print(exception)
    else:
      sys.stdout.write('.')
      sys.stdout.flush()
      response = numpy.array(
          result_future.result().outputs['scores'].float_val)
      prediction = numpy.argmax(response)
      if label != prediction:
        result_counter.inc_error()
    result_counter.inc_done()
    result_counter.dec_active()
def _callback ( result_future ) : exception = result_future . exception ( ) if exception : result_counter . inc_error ( ) print ( exception ) else : sys . stdout . write ( '.' ) sys . stdout . flush ( ) response = numpy . array ( result_future . result ( ) . outputs [ 'scores' ] . float_val ) prediction = numpy . argmax ( response ) if label != prediction : result_counter . inc_error ( ) result_counter . inc_done ( ) result_counter . dec_active ( )
Callback function.
Callback function .
"""Callback function.

    Calculates the statistics for the prediction result.

    Args:
      result_future: Result future of the RPC.
    """
result_future
Result future of the RPC.
Result future of the RPC .