【发布时间】:2017-08-12 19:50:18
【问题描述】:
我正在尝试创建一个使用 tensorflow 进行对象分类的 android 应用程序。我已经使用 MobileNet-SSD 训练了一个简单的模型。我根据here 给出的指导线创建了应用程序。它适用于该示例中使用的模型,但是对于我创建的模型,它给了我以下错误:
Caused by: java.lang.RuntimeException: Node 'output' does not exist in model 'file:///android_asset/ssd_mobilenet_2classes.pb'
at org.tensorflow.contrib.android.TensorFlowInferenceInterface.graphOperation(TensorFlowInferenceInterface.java:173)
at com.mindorks.tensorflowexample.TensorFlowImageClassifier.create(TensorFlowImageClassifier.java:111)
尝试执行以下代码时出现异常:
classifier = TensorFlowImageClassifier.create(
getAssets(),
MODEL_FILE,
LABEL_FILE,
INPUT_SIZE,
IMAGE_MEAN,
IMAGE_STD,
"input",
"output");
但是当我使用 tensorflow object detection tutorial 测试模型时,它运行良好。
有人可以帮我解决这个问题吗?
谢谢。
【问题讨论】:
-
你将模型文件放在项目中的什么位置?
-
在 assets 文件夹中,就像示例模型的放置方式一样。
-
确保文件名与代码中的一样。我猜你犯了一些拼写错误或资产文件夹在错误的位置。你能展示一下项目结构吗?
标签: java android tensorflow deep-learning