要求¶
Note
我们只支持通过conda安装要求的软件包。
- Python 2 >= 2.6 或 Python 3 >= 3.3
- 建议使用开发包(在大多数Linux发行版上为
python-dev
或python-devel
)(见下文)。0.6及以前的版本支持Python 2.4。0.8.2及以前的版本支持Python 2.6。对于Python 3,支持3.3之后的版本。- NumPy >= 1.9.1 < 1.11.1
- 早期版本可以工作,但我们没有测试。
- SciPy >= 0.14 < 0.17.1
- 当前只有稀疏矩阵和特殊函数需要它的支持,但强烈推荐。SciPy > = 0.8可以工作,但早期版本对稀疏矩阵有已知的错误。
- BLAS安装(具有Level 3的功能)
- 推荐:MKL,通过Conda免费安装。
- 或者,我们建议安装OpenBLAS,其中包含development headers(
-dev
,-devel
,具体取决于你的Linux发行版本)。
Optional requirements
g++
(Linux and Windows),clang
(OS X)- Highly recommended. Theano can fall back on a NumPy-based Python execution model, but a C compiler allows for vastly faster execution.
- nose >= 1.3.0
- 推荐,用于运行Theano的测试套件。
- Sphinx >= 0.5.1, pygments
- For building the documentation. LaTeX和dvipng也是必需的,用于将数学符号显示为图像。
- pydot-ng
- 处理大的gif/images图片。
- NVIDIA CUDA drivers and SDK
- Highly recommended Required for GPU code generation/execution on NVIDIA gpus. See instruction below.
- libgpuarray
- 在CUDA和OpenCL设备上生成GPU/CPU代码时需要(参见:GpuArray Backend。)
通过Conda安装的要求的软件包(推荐)¶
安装和配置GPU驱动程序(推荐)¶
Warning
现在OpenCL仍然是最小支持。
Install CUDA drivers
- Follow this link to install the CUDA driver and the CUDA Toolkit.
- 你必须在驱动程序安装后重新启动计算机。
- 测试在重新启动之后可以正确加载它,从命令行执行命令nvidia-smi。
Note
Sanity check: The bin subfolder should contain an nvcc program. This folder is called the cuda root directory.
- Fix ‘lib’ path
- 添加'lib'子目录(如果你有一个64位操作系统,则为“lib64”子目录)到你的
$LD_LIBRARY_PATH
环境变量。
- 添加'lib'子目录(如果你有一个64位操作系统,则为“lib64”子目录)到你的
Set Theano’s config flags
要使用GPU,你需要定义cuda root。You can do it in one of the following ways:
- 定义一个$CUDA_ROOT环境变量等于cuda根目录,如
CUDA_ROOT=/path/to/cuda/root
,或 - 向
THEANO_FLAGS
添加cuda.root
标记,如THEANO_FLAGS='cuda.root=/path/to/cuda/root'
,或 - 添加一个[cuda]节到你的.theanorc文件,包含选项
root = /path/to/cuda/root
。
- 定义一个$CUDA_ROOT环境变量等于cuda根目录,如