Tensorflow安装:sklearn上的ImportError - 未定义的符号:PyFPE_jbuf

时间:2016-05-03 12:28:49

标签: python scikit-learn tensorflow importerror

使用TensorFlow关注深度学习的Udacity课程,并在此处遇到障碍:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/udacity/1_notmnist.ipynb

我试图让安装运行,但初始导入效果不佳。具体来说,这个导入错误在某个文件上:

  

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

在Ubuntu 14.04上的virtualenv安装中运行tensorflow应该有帮助。

---------------------------------------------------------------------------
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

这里有谁知道如何继续?(也许这是一个非常简单的错误 - 我对此非常新手)

更新: 当我从普通终端运行iPython笔记本时,一切正常,而不是从tensorflow虚拟环境运行它们(就像我第一次发布这个问题时那样)。但我不明白为什么会这样。

1 个答案:

答案 0 :(得分:0)

我在sklearn处理张量流时遇到了麻烦。我已下载并手动安装最新版本到TSNE模块工作。也许这对你也有用吗?

步骤1:手动安装Cython - 您将版本&gt; 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

第2步:安装最新版本的skilearn