How To Predict A Specific Image Using Mnist
Solution 1:
I'm summing up what we said in the comments in this answer.
Placeholder error:
Your prediction.eval()
call has a feed_dict
that doesn't contain a value for p_keep_conv
and p_keep_hidden
. Note that, since you don't provide a name=...
argument whe defining your placholders, they get the default name Placeholder_N
which is what the error message shows. It's a good practice to always give a meaningful name to variables, constants and placeholders in order to make debugging easier.
Argmax expected dimension:
tf.argmax
's definition states:
axis: A Tensor. Must be one of the following types: int32, int64. int32, 0 <= axis < rank(input). Describes which axis of the input Tensor to reduce across.
It seems, then, that the only way to run argmax
on the last axis of the tensor is by giving it axis=-1
, because of the "strictly less than" sign in the definition of the function (I don't understand why they made this design choice).
Post a Comment for "How To Predict A Specific Image Using Mnist"