‘tensorflow.python.framework.ops.EagerTensor‘ object has no attribute ‘nn‘

‘tensorflow.python.framework.ops.EagerTensor’ object has no attribute ‘nn’

在最新版本中 TensorFlow.nn 与keras等库一样,已经被从TensorFlow中的提了出来,作为单独的库,与keras不同的是,keras被提出来作为单独的库,在TensorFlow中依旧保留了keras,而nn却没有。
引入TensorFlow.nn:

from tensorflow import  nn

你可能感兴趣的:(TensorFlow库,tensorflow,深度学习,python,机器学习,gpu)