解决:tf.placeholder(“float“, [None, width]) AttributeError: module ‘tensorflow‘ has no attribute ‘plac
这个错误表明正在使用TensorFlow2.x,而代码是基于TensorFlow1.x编写的。tf.placeholder是TensorFlow1.x中的特性,在TensorFlow2.x中已经被移除,因为即时执行模式(EagerExecution)取代了静态图的机制。解决方法1.修改代码以兼容TensorFlow2.x在TensorFlow2.x中,可以直接使用普通的Python张量或tf.ke