【问题标题】:Tensorflow Serving Client / Base64 Issue / Error 3Tensorflow 服务客户端/Base64 问题/错误 3
【发布时间】:2017-06-19 21:36:11
【问题描述】:

我想在 Tensorflow Serving 上启动并运行以下模型:

https://github.com/mdietrichstein/tensorflow-open_nsfw

我已使用以下代码导出模型:https://github.com/mdietrichstein/tensorflow-open_nsfw/blob/master/tools/export_model.py

但是在尝试使用 node.js 客户端计算结果时出现以下错误:

{ code: 3, 
  details: 'Invalid character found in base64.\n\t 
  [[Node: map/while/DecodeBase64 = DecodeBase64[_output_shapes=[[]],
  _device="/job:localhost/replica:0/task:0/cpu:0"](map/while/TensorArrayReadV3)]]',
  metadata: Metadata {
   _ internal_repr: {}
  }
}

我的客户端配置了测试服务器地址的代码可以在这里找到:

https://github.com/delta9/tensorflow-serving-node-client

有没有人遇到过类似的问题,如果有,您是如何解决的?

非常感谢

【问题讨论】:

    标签: python node.js tensorflow tensorflow-serving


    【解决方案1】:

    您应该使用网络安全的 base64 编码。 base64.urlsafe_b64encode(open('test.jpg', 'rb').read()) 因为 tensorflow.decode_base64 使用 WEB-SAFE 模型来解码 base64 编码。 tensorflow.decode_base64的官方文档是:

    解码网络安全的 base64 编码字符串。 输入的末尾可能有也可能没有填充。有关填充,请参见 EncodeBase64。 网络安全意味着输入必须使用 - 和 _ 而不是 + 和 /。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-11
      • 1970-01-01
      • 2011-05-26
      • 1970-01-01
      • 1970-01-01
      • 2016-03-30
      • 2011-06-06
      • 2011-11-23
      相关资源
      最近更新 更多