我想从Tensorflow库导入Keras。所以我做了以下事情:
import tensorflow.python.keras as keras
但是这个导入抛出了一个错误:
AttributeError: module 'tensorflow' has no attribute 'python'
似乎以下两个导入都正常工作:
import tensorflow.python.keras
from tensorflow.python import keras
对我来说,import tensorflow.python.keras as keras
和from tensorflow.python import keras
是相同的,但看起来不是真的。这两种进口商品有什么区别?你知道吗
你应该这样做:
第一行帮助您使用带有
tf
短名称(asname)的tensorflow
模块。你知道吗对于asname,您可以检查这个thread。你知道吗
相关问题 更多 >
编程相关推荐