Code Monkey home page Code Monkey logo

deploydlkubeflowaks's Introduction

Deploy CNN models using Kubeflow on AKS.

Acknowledgements: Mathew Salvaris, JS Tan

In this repository, we provide instructions on how to deploy a Keras CNN model using Kubeflow running on Azure Kubernetes Service (AKS).

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

deploydlkubeflowaks's People

Contributors

fboylu avatar microsoftopensource avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deploydlkubeflowaks's Issues

Error while inferencing from the tensorflow_serving

The saved_model_cli of the saved model is

MetaGraphDef with tag-set: 'serve' contains the following SignatureDefs:

signature_def['serving_default']:
  The given SavedModel SignatureDef contains the following input(s):
    inputs['input_image'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 299, 299, 3)
        name: input_1_1:0
  The given SavedModel SignatureDef contains the following output(s):
    outputs['predictions_1/Softmax:0'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 1000)
        name: predictions_1/Softmax:0
  Method name is: tensorflow/serving/predict

The feature of image is generated as

img = image.load_img(img_path, target_size=(299, 299))
img = image.img_to_array(img)
# img = np.expand_dims(img, axis=0)
img = preprocess_input(img)
img.shape()
 Ret: (299, 299, 3)
data = json.dumps({"signature_name": "serving_default", "instances": [img.tolist()]})
print('Data: {} ... {}'.format(data[:50], data[len(data)-52:]))
 Ret: Data: {"signature_name": "serving_default", "instances": ... 805, -0.08235293626785278, -0.18431371450424194]]]]}

And while doing the prediction from the served model,

headers = {"content-type": "application/json"}
response = requests.post('http://localhost:8501/v1/model/inception:predict', data=data, headers=headers)
predictions = json.loads(response.text)['predictions']

Ret : KeyError                                  Traceback (most recent call last)
<ipython-input-148-5835e27c0dc9> in <module>
      1 headers = {"content-type": "application/json"}
      2 response = requests.post('http://localhost:8501/v1/model/inception:predict', data=data, headers=headers)
----> 3 predictions = json.loads(response.text)['predictions']

KeyError: 'predictions'

Or

response.text
 Ret: '{ "error": "Malformed request: POST /v1/model/inception:predict" }' 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.