使用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虚拟环境运行它们(就像我第一次发布这个问题时所做的那样)。我不明白为什么会发生这种事。
我在处理张量流时也遇到了sklearn的问题。我必须下载它并手动将最新版本安装到TSNE模块才能工作。也许这对你也有用?
步骤1:手动安装Cython-您将版本>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