ModuleNotFoundError:没有名为“ tensorflow.contrib.framework”的模块

时间:2018-07-24 01:39:44

标签: python tensorflow

当我在Python中导入tflearn时,它说ModuleNotFoundError:没有名为“ tensorflow.contrib.framework”的模块,有人知道如何处理此问题吗?谢谢。

Traceback (most recent call last):
File "", line 1, in 
File "C:\Users\User\Anaconda3\lib\site-packages\tflearn_init_.py", line 4, in 
from . import config
File "C:\Users\User\Anaconda3\lib\site-packages\tflearn\config.py", line 5, in 
from .variables import variable
File "C:\Users\User\Anaconda3\lib\site-packages\tflearn\variables.py", line 7, in 
from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope
ModuleNotFoundError: No module named 'tensorflow.contrib.framework'

1 个答案:

答案 0 :(得分:1)

错误消息表明模块尚未安装/找到。

例如,我没有安装tflearn,但是我安装了tensorflow。

>>> from tensorflow.contrib.framework.python.ops import add_arg_scope
>>> import tflearn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tflearn'

尝试导入整个tensorflow模块,看看是否遇到相同的错误。如果是这样,请尝试重新安装tensorflow模块。

相关问题