Tensorflow服务客户端问题

时间:2018-03-08 05:45:31

标签: python tensorflow keras tensorflow-serving

我使用Keras训练并保存了TF模型,并能够将Keras模型(hdf5)转换为Tensorflow服务。

设置训练和保存Modle的详细信息: Python版本:2.7.5 Keras版本:2.1.4使用TensorFlow后端。 Tensorflow CPU:1.5.0

我有Tensorflow服务的Docker镜像 当我尝试使用sample_client.py运行客户端时,它失败并出现以下错误。谁能建议我如何继续前进?

 HttpClient httpClient = new DefaultHttpClient();
                    HttpGet httpPost = new HttpGet(url);
                    HttpResponse response = httpClient.execute(httpPost);
                    HttpEntity entity = response.getEntity();

                    String responseString = EntityUtils.toString(entity);

先谢谢

此致 Latha

1 个答案:

答案 0 :(得分:0)

错误是由于tensorflow_model_server中的TensorFlow版本只是早于1.5的原因,因此不知道如何实例化该运算符。

尝试在较旧的TensorFlow版本上重建模型,或尝试使用较新的TensorFlow版本创建tensorflow_model_server。

只需按照此处给出的步骤构建具有最新Tensorflow服务源的docker。 https://www.tensorflow.org/serving/docker

相关问题