jjzjj

TensorFlowInferenceInterface

全部标签

android - Tensorflow - 如何卡住 SavedModel 中的 .pb 以用于 TensorFlowInferenceInterface 中的推理?

根据thisanswer,我可以提取MetaGraph来自SavedModel,然后卡住MetaGraph的GraphDef,然后运行​​freeze_graph.py上面的脚本GraphDef得到.pb可在安卓系统中使用。我的问题:我究竟该如何提取MetaGraph(然后是GraphDef)?因为tf.saved_model.loader.load(sess,[tag_constants.SERVING],)返回MetaGraphDef而不是MetaGraph. 最佳答案 刚收到。事实证明,在删除我从conda获得的Tensorf

java - 如何通过 TensorFlowInferenceInterface.java 提供 boolean 值占位符?

我正在尝试通过JavaTensorflowAPI启动在KerasTensorflow中训练的图形。除了标准输入图像占位符之外,该图还包含需要输入boolean值的'keras_learning_phase'占位符。问题是,TensorFlowInferenceInterface中没有方法对于boolean值-您只能使用float、double、int或byte值。显然,当我尝试通过以下代码将int传递给此张量时:inferenceInterface.fillNodeInt("keras_learning_phase",newint[]{1},newint[]{0});我明白了tenso