为什么python2.7导入“来自tensorflow.python.util导入嵌套”失败

时间:2016-12-18 11:32:19

标签: python python-2.7 tensorflow importerror

我使用python2.7失败

在python2.7中

>>> from tensorflow.python.util import nest 
Traceback (most recent calllast): 
  File "<stdin>", line 1, in <module> 
ImportError: cannot import name nest

但我尝试使用python3.5来运行from tensorflow.python.util import nest是好的

1 个答案:

答案 0 :(得分:0)

我能够在python 2.7上运行该import语句而没有任何问题。也许你的python 2安装很不稳定或者你的张量流已经过时了(我正在运行0.12.0-rc1)。

Python 2.7.12 (default, Dec  1 2016, 21:24:23) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
>>> from tensorflow.python.util import nest 
>>> 
相关问题