AttributeError: module ‘tensorflow’ has no attribute 'placeholder’问题 1 问题原因 在tf2下使用了tf1的API 2解决方法 (1)输入以下代码查看tensorflow版本 print(tf.__version__) 此图可以说明你的tensorflow版本是tf2. (2)将导入模块替换,并使用tf2的行为。 import tensorflow as tf import tensorflow.compat.v1