tf.placeholder() is not compatible with eager execution

571 views Asked by At

I am working on a project and am trying to replace this block of code with something that works. I am using version 2.5.0 of tensorflow and am faced with the following error.

AttributeError: module 'tensorflow' has no attribute 'placeholder'

When i used this.

tf.compat.v1.placeholder(dtype, shape=None, name=None)

  with tf.compat.v1.variable_scope("regression"):
    x = tf.compat.v1.placeholder(tf.float32, [None, 901])
    y, variables = regression(x)

This error occurs.

** RuntimeError: tf.placeholder() is not compatible with eager execution.**

kindly help me solve it.

Thanks!

0

There are 0 answers