module 'tensorflow' has no attribute 'random'
问题 i'm trying to generate seed using TensorFlow 2.1 but this error appears module 'TensorFlow' has no attribute 'random' 回答1: I suspect that you think you're using TensorFlow 2.0 but actually, it is a previous version of tensorflow. It's easy to check: import tensorflow as tf print(tf.__version__) This should produce output like this: 2.1.0 If not, you know you have the wrong TensorFlow version installed. It's also possible that you have multiple versions of python installed. For example: Python