Closed metjush closed 8 years ago
Which version of tensorflow do you have? This seems like an issue with using 0.5 version.
You can try updating tensorflow by doing this:
pip uninstall tensorflow
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.6.0-cp27-none-linux_x86_64.whl
I just had the same issue as @metjush, and discovered I had version 0.5.0 of TensorFlow. After upgrading to 0.6.0 the example above then ran as expected, so this solved the problem. :-)
Thanks both. I updated tensorflow to 0.6.0. It now raises a different error:
RuntimeError: module compiled against API version a but this version of numpy is 9
Traceback (most recent call last):
File "skflow_test.py", line 3, in <module>
import skflow
File "/Users/metjush/anaconda/lib/python2.7/site-packages/skflow/__init__.py", line 17, in <module>
import tensorflow as tf
File "/Users/metjush/anaconda/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/Users/metjush/anaconda/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 50, in <module>
from tensorflow.python.framework.framework_lib import *
File "/Users/metjush/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/framework_lib.py", line 62, in <module>
from tensorflow.python.framework.ops import Graph
File "/Users/metjush/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 40, in <module>
from tensorflow.python.framework import versions
File "/Users/metjush/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/versions.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Users/metjush/anaconda/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/Users/metjush/anaconda/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: numpy.core.multiarray failed to import
It is trying to load numpy
from a different python distribution, not anaconda (even though I run it with the python
command from anaconda). I can't seem to make it load the right one.
@metjush See this for potential solution: http://stackoverflow.com/questions/20518632/importerror-numpy-core-multiarray-failed-to-import
Should be able to load correctly if numpy version is correct. Thanks.
I'm trying the tutorial on Medium (https://medium.com/@ilblackdragon/tensorflow-tutorial-part-2-9ffe47049c92#.608vwpu2a) and the first DNN have raised this error:
Is this a problem with my tensorflow installation? Or is there something different amiss? I have an up-to-date installation of TF, this is what happens when I run
pip install tensorflow --upgrade
:This is my Python setup: