I\'m a newbie to TensorFlow. I\'m confused about the difference between tf.placeholder
and tf.Variable
. In my view, tf.placeholder
is
Tensorflow 2.0 Compatible Answer: The concept of Placeholders, tf.placeholder
will not be available in Tensorflow 2.x (>= 2.0)
by default, as the Default Execution Mode is Eager Execution.
However, we can use them if used in Graph Mode
(Disable Eager Execution
).
Equivalent command for TF Placeholder in version 2.x is tf.compat.v1.placeholder
.
Equivalent Command for TF Variable in version 2.x is tf.Variable
and if you want to migrate the code from 1.x to 2.x, the equivalent command is
tf.compat.v2.Variable
.
Please refer this Tensorflow Page for more information about Tensorflow Version 2.0.
Please refer the Migration Guide for more information about migration from versions 1.x to 2.x.