tensorflow: TypeError('{!r} is not a Python function'.format(func))
When I import tensorflow, It raise an error like this(the newest version of tensorflow via pip installtaion)
` /usr/bin/python2.7 /home/dell/wxm/Code/ImageCaption-tensorflow/test.py Traceback (most recent call last): File “/home/dell/wxm/Code/ImageCaption-tensorflow/test.py”, line 3, in <module> import tensorflow as tf File “/usr/local/lib/python2.7/dist-packages/tensorflow/init.py”, line 23, in <module> from tensorflow.python import * File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/init.py”, line 62, in <module> import tensorflow.contrib as contrib File “/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/init.py”, line 26, in <module> from tensorflow.contrib import learn File “/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/init.py”, line 20, in <module> from tensorflow.contrib.learn.python.learn import * File “/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/init.py”, line 20, in <module> from tensorflow.contrib.learn.python.learn import * File “/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/init.py”, line 22, in <module> from tensorflow.contrib.learn.python.learn.io import * File “/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/io/init.py”, line 20, in <module> from tensorflow.contrib.learn.python.learn.io.dask_io import * File “/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/io/dask_io.py”, line 23, in <module> import dask.dataframe as dd File “/usr/local/lib/python2.7/dist-packages/dask/dataframe/init.py”, line 1, in <module> from .core import (DataFrame, Series, Index, _Frame, map_partitions, File “/usr/local/lib/python2.7/dist-packages/dask/dataframe/core.py”, line 1234, in <module> class Index(Series): File “/usr/local/lib/python2.7/dist-packages/dask/dataframe/core.py”, line 1266, in Index @derived_from(pd.Index) File “/usr/local/lib/python2.7/dist-packages/dask/utils.py”, line 526, in wrapper original_args = getargspec(original_method).args File “/usr/local/lib/python2.7/dist-packages/dask/compatibility.py”, line 190, in getargspec return _getargspec(func) File “/usr/local/lib/python2.7/dist-packages/dask/compatibility.py”, line 56, in _getargspec return inspect.getargspec(func) File “/usr/lib/python2.7/inspect.py”, line 816, in getargspec raise TypeError(‘{!r} is not a Python function’.format(func)) TypeError: <method ‘max’ of ‘numpy.ndarray’ objects> is not a Python function
Process finished with exit code 1 `
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 26 (9 by maintainers)
Commits related to this issue
- Merge pull request #2045 from ROCmSoftwarePlatform/develop-upstream-fix-python-dist-loc Fix python3 set up in Dockerfile.rocm — committed to fsx950223/tensorflow by jayfurmanek a year ago
Per @jreback, if you are using dask you should have a relatively recent version of pandas, say >= 0.17.0 (even better is 0.18.0); certain older versions will work, but may cause unexpected things.
@meanmee @liuyifly06 @byungjo @ruilog @jessebett Uninstall dask if you don’t intend to use it. If you need to use it, use newer versions of pandas and dask.