2017-02-05 32 views
1

我正在尝试使用Theano和Lasagne构建Docker镜像。这些是主要的步骤:numpy安装中缺少numpy.distutils,Theano尝试使用它

FROM nvidia/cuda:8.0-cudnn5-devel 
RUN apt-get install -y libopenblas-dev python-dev python-pip 
RUN pip install --upgrade pip 
RUN pip install nose numpy scipy pandas h5py scikit-image scikit-learn jupyter 
RUN pip freeze > requirements.txt && pip install -r requirements.txt --upgrade && rm requirements.txt 
RUN pip install --upgrade https://github.com/Theano/Theano/archive/master.zip 
RUN pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip 

当图像准备好我启动它,并尝试通过简单地在IPython的进口theano测试theano。我得到以下错误(它的结束):

/usr/local/lib/python2.7/dist-packages/theano/gof/cmodule.pyc in std_include_dirs() 
    1579 
    1580 def std_include_dirs(): 
-> 1581  numpy_inc_dirs = np.distutils.misc_util.get_numpy_include_dirs() 
    1582  py_inc = distutils.sysconfig.get_python_inc() 
    1583  py_plat_spec_inc = distutils.sysconfig.get_python_inc(plat_specific=True) 

AttributeError: 'module' object has no attribute 'distutils' 

根据画中画安装的版本是:numpy的(1.12.0)和Theano(0.9.0b1)。我有另一个图像出于某种原因。 numpy.distutils不存在,但Theano不会尝试在import theano命令中调用它。

  1. 为什么不是numpy.distutilsnumpy一起安装?
  2. 为什么Theano尝试使用它?
  3. 最重要的是:我该如何解决这个问题?

回答

0

安装https://github.com/Theano/Theano/archive/master.zip为您提供该库的测试版,并且它似乎对每个系统都不能正常工作。

除非你绝对需要Theano 0.9的一些功能,否则我建议你从pip自己的仓库安装。可能对Lasagne做同样的事情。

RUN pip install theano lasagne