在网络上使用我自己的数据时出现Tensorflow错误?

时间:2016-07-04 07:27:49

标签: tensorflow

我是新来的。现在我在tensorfly web example学习 在模型forld的Model.py中,我更改了第32行和第34行:

y_tensor = sess.graph.get_tensor_by_name('final_result:0')
y = sess.run(y_tensor, {'DecodeJpeg/contents:0': imageData})

和final_result是我自己的模特!我不知道DecodeJpeg /内容:0'它犯了一个错误:

ValueError: Cannot feed value of shape (1, 224, 224, 3) for Tensor u'DecodeJpeg/contents:0', which has shape '()'

我做什么?那是什么意思?请帮帮忙?

1 个答案:

答案 0 :(得分:0)

在我自己的数据上加载重新训练的模型时遇到了同样的问题。

问题是因为张量u'DecodeJpeg/contents:0'需要图像输入的字符串格式而不是numpy数组。您可以在run_bottleneck_on_image函数的说明中找到原始用法。