keras:你必须为占位符张量输入一个值" input_1'与dtype浮动和形状[?,224,224,3]

时间:2018-06-10 22:04:26

标签: python tensorflow keras

我的模型摘要并未表明存在' input_1'但是,当我尝试运行代码时,它会显示错误,如图所示。我是keras的新手,我坚持这一点。你能给我一个方向吗?

You must feed a value for placeholder tensor 'input_1' with dtype float and shape [?,224,224,3]
 [[Node: input_1 = Placeholder[dtype=DT_FLOAT, shape=[?,224,224,3], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

This html file contains a jupyter notebook of my code with the error which is mentioned above .

1 个答案:

答案 0 :(得分:0)

首先,您应该知道,如果没有Eager,tensorflow是一个静态模型,这意味着您应该首先构建模型并为模型提供值。您似乎首先创建了一个占位符,然后只运行模型而不为占位符提供值。我相信你应该为你的占位符提供[self.batch_size,224,224,3]。