首页 > 解决方案 > 可以从 tensorflow.python.keras 导入元素,但不能将模块作为一个整体

问题描述

下面的 python 会话有什么意义?

(ctlearn) jsevillamol@jsevillamol-N551JK:~/Documentos/ctlearn_keras$ python
Python 3.6.5 | packaged by conda-forge | (default, Apr  6 2018, 13:39:56) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow.python.keras.models import Model
>>> import tensorflow.python.keras as K
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'python'

我可以进口tensorflow.python.keras.models,但不能进口tensorflow.python.keras

什么。我什至没有。

标签: pythontensorflowkeraspython-import

解决方案


推荐阅读