TensorFlow REST Frontend but not TensorFlow Serving

前端 未结 3 1589
情深已故
情深已故 2021-02-04 01:07

I want to deploy a simple TensorFlow model and run it in REST service like Flask. Did not find so far good example on github or here.

I am not ready to use TF Serving as

3条回答
  •  执笔经年
    2021-02-04 01:43

    This github project shows a working example of restoring a model checkpoint and using Flask.

    @app.route('/api/mnist', methods=['POST'])
    def mnist():
        input = ((255 - np.array(request.json, dtype=np.uint8)) / 255.0).reshape(1, 784)
        output1 = simple(input)
        output2 = convolutional(input)
        return jsonify(results=[output1, output2])
    

    The online demo seems pretty quick.

提交回复
热议问题