为什么python2.7导入"from tensorflow.python.util import nest"失败



我使用了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是可以的

我能够在Python 2.7上没有任何问题运行该导入语句。也许您的python 2安装很不错,或者您的TensorFlow已过时(我正在运行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 
>>> 

最新更新