Why python2.7 import "from tensorflow.python.util import nest " failed

1.5k Views Asked by At

i used python2.7 is failed

in python2.7

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

but I try to use python3.5 to run from tensorflow.python.util import nest is ok

1

There are 1 best solutions below

1
On BEST ANSWER

I was able to run that import statement without any issues on python 2.7. Perhaps your python 2 install is wonky or your tensorflow is out of date (I'm running 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 
>>>