-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full more refactoring to tf agnostic.
- Loading branch information
Showing
15 changed files
with
114 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import logging | ||
import numpy as np | ||
|
||
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 = 'incv4' | ||
model_version = 1 | ||
img = np.zeros((299, 299, 3)).astype(int) | ||
req_data = [{'in_tensor_name': 'inputs', 'in_tensor_dtype': 'DT_UINT8', 'data': img}] | ||
|
||
client = ProdClient(host, model_name, model_version) | ||
|
||
prediction = client.predict(req_data, request_timeout=10) | ||
for k in prediction: | ||
logger.info('Prediction key: {}, shape: {}'.format(k, prediction[k].shape)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class MockClient: | ||
def __init__(self, mock_reponse): | ||
self.mock_reponse = mock_reponse | ||
|
||
def predict(self, request_data, **kwargs): | ||
return self.mock_reponse |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Run a simple inception model with bottleneck output layer | ||
docker run -it -p 9000:9000 epigramai/model-server:incv4 | ||
docker run -it -p 9001:9000 epigramai/model-server:incv4 | ||
|
||
# To stop and remove container | ||
# docker stop incv4 && docker rm incv4 |
Binary file not shown.