Shiva
Shiva

Reputation: 483

Tensorflow installation: ImportError on sklearn - undefined symbol: PyFPE_jbuf

Following the Udacity course on Deep Learning with TensorFlow, and hit a roadblock here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/udacity/1_notmnist.ipynb

I tried to get the installation running, but the initial imports didn't work out so well. Specifically, this import error on a certain file:

/tensorflow/lib/python2.7/site-packages/sklearn/linear_model/cd_fast.so

Running tensorflow in a virtualenv installation on Ubuntu 14.04, should that help.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-72264e7a4df2> in <module>()
      9 from IPython.display import display, Image
     10 from scipy import ndimage
---> 11 from sklearn.linear_model import LogisticRegression
     12 from six.moves.urllib.request import urlretrieve
     13 from six.moves import cPickle as pickle

.../tensorflow/lib/python2.7/site-packages/sklearn/linear_model/__init__.py in <module>()
     15 from .least_angle import (Lars, LassoLars, lars_path, LarsCV, LassoLarsCV,
     16                           LassoLarsIC)
---> 17 from .coordinate_descent import (Lasso, ElasticNet, LassoCV, ElasticNetCV,
     18                                  lasso_path, enet_path, MultiTaskLasso,
     19                                  MultiTaskElasticNet, MultiTaskElasticNetCV,

.../tensorflow/lib/python2.7/site-packages/sklearn/linear_model/coordinate_descent.py in <module>()
     27 from ..utils import ConvergenceWarning
     28 
---> 29 from . import cd_fast
     30 
     31 

ImportError: .../tensorflow/lib/python2.7/site-packages/sklearn/linear_model/cd_fast.so: undefined symbol: PyFPE_jbuf

Anyone here who knows how to proceed? (Maybe this is a very simple error - I'm quite the newbie to this)

UPDATE: Everything works fine when I run the iPython Notebooks from the usual terminal, as opposed to running them from the tensorflow virtual environment (as I had done when I first posted this question). I do not understand why this happened, though.

Upvotes: 1

Views: 1171

Answers (1)

Yonatan Simson
Yonatan Simson

Reputation: 2575

I also had trouble with sklearn in working with tensor flow. I had dowload it and install latest version manually to the TSNE module to work. Perhaps this will work for you too?

Step 1: Install Cython manually - you will version > 0.21

mkdir cython
cd cython
wget http://cython.org/release/Cython-0.24.zip
unzip Cython-0.24.zip
cd Cython-0.24
sudo python setup.py install

Step 2: Install latest version of skilearn

Upvotes: 0

Related Questions