You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> My tensorflow image_classifier is running on tf_hub_serving right with the help of epigramai medium tutorial
Successfully, I was able to run the sample model of the addition of two number with that tutorial. With this client program.
import logging
from predict_client.prod_client import ProdClient
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(name)s - %(message)s')
# In each file/module, do this to get the module name in the logs
logger = logging.getLogger(__name__)
# Make sure you have a model running on localhost:9000
host = 'localhost:9000'
model_name = 'simple'
model_version = 1
client = ProdClient(host, model_name, model_version)
req_data = [{'in_tensor_name': 'a', 'in_tensor_dtype': 'DT_INT32', 'data': 2}]
prediction = client.predict(req_data, request_timeout=10)
logger.info('Prediction: {}'.format(prediction))
And now I have trained image_classifier with the help of this tensorflow script retrain.py.
The model has been trained successfully, and its running on tensorflow serving but my real question ishow to pass an image so that it will make a prediction? I edited that working client code for addition of two number but it is returning error.
The model is running on localhost:9001 for now.
The image_classifier_serving_client_code is:
import logging
import cv2
from predict_client.prod_client import ProdClient
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(name)s - %(message)s')
# In each file/module, do this to get the module name in the logs
logger = logging.getLogger(__name__)
# Make sure you have a model running on localhost:9000
host = 'localhost:9001'
model_name = 'off_shoulder'
model_version = 1525854035
client = ProdClient(host, model_name, model_version)
img = cv2.imread("temp.jpg", cv2.IMREAD_COLOR)
req_data = [{'in_tensor_name': 'image', 'in_tensor_dtype': 'DT_UINT8', 'data': img}]
prediction = client.predict(req_data, request_timeout=10)
logger.info('Prediction: {}'.format(prediction))
The error generated is:
2018-05-10 10:59:04,435 - INFO - ProdClient - Sending request to tfserving model
2018-05-10 10:59:04,435 - INFO - ProdClient - Host: localhost:9001
2018-05-10 10:59:04,436 - INFO - ProdClient - Model name: off_shoulder
2018-05-10 10:59:04,436 - INFO - ProdClient - Model version: 1525854035
2018-05-10 10:59:04,443 - DEBUG - ProdClient - Establishing insecure channel took: 0.007186412811279297
2018-05-10 10:59:04,444 - DEBUG - ProdClient - Creating stub took: 4.410743713378906e-05
2018-05-10 10:59:04,444 - DEBUG - ProdClient - Creating request object took: 4.1961669921875e-05
2018-05-10 10:59:04,524 - DEBUG - ProdClient - Making tensor protos took: 0.07967543601989746
2018-05-10 10:59:04,573 - ERROR - ProdClient - <_Rendezvous of RPC that terminated with (StatusCode.UNAVAILABLE, OS Error)>
2018-05-10 10:59:04,574 - ERROR - ProdClient - Prediction failed!
2018-05-10 10:59:04,576 - INFO - __main__ - Prediction: {}
Any help! Urgent!
The text was updated successfully, but these errors were encountered:
Can you show me the logs from the model server? StatusCode.UNAVAILABLE typically means that the server is not running, running on a different port, etc.
> My tensorflow image_classifier is running on tf_hub_serving right with the help of epigramai medium tutorial
Successfully, I was able to run the sample model of the addition of two number with that tutorial. With this client program.
And now I have trained image_classifier with the help of this tensorflow script retrain.py.
The model has been trained successfully, and its running on tensorflow serving but my real question is how to pass an image so that it will make a prediction? I edited that working client code for addition of two number but it is returning error.
The model is running on localhost:9001 for now.
The image_classifier_serving_client_code is:
The error generated is:
Any help! Urgent!
The text was updated successfully, but these errors were encountered: