install Welcome to MkDocs
Prerequisites
Stable Lasagne release
GP支持
Thanks to Theano, Lasagne transparently supports training your networks on a GPU, which may be 10 to 50 times faster than training them on a CPU. Currently, this requires an NVIDIA GPU with CUDA support, and some additional software for Theano to use it. 感谢Theano,Lasagne 可以透明地支持GPU运行,训练速度是CPU的10-50倍。 现在,我们需要一块支持CUDA的NVIDA GPU,和一些额外的软件。
CUDA
Install the latest CUDA Toolkit and possibly the corresponding driver available from NVIDIA: https://developer.nvidia.com/cuda-downloads
请安装最新的 CUDA 组件和可能需要的相关驱动,参考NVIDIA: https://developer.nvidia.com/cuda-downloads
Theano
如果CUDA 设置正常的话,将会打印关于GPU的信息(如果你有多个GPU的话,将会是第一个CUDA-capable的GPU)
THEANO_FLAGS=device=gpu python -c "import theano; print(theano.sandbox.cuda.device_properties(0))"
如果把GPU设为Theano的默认选项的话,在你的主目录中建立一个.theanorc文件,并填入以下内容:
[global]
floatX = float32
device = gpu
If you run into problems, please check Theano’s instructions for Using the GPU.
如果你的运行出现问题,请参考Theano 的Using the GPU。
Docker
如果不想按照以上描述的方法手动安装Theano 和 Lasagne,你还可以用pre-made Docker image: Lasagne Docker (CPU) or Lasagne Docker (CUDA)。他们可以每周更新最新的Theano 和 Lasagne。运行方法如下(例子):
sudo docker run -it kaixhin/lasagne
sudo nvidia-docker run -it kaixhin/cuda-lasagne:7.0
想了解更多Docker信息,请参考官方文档。CUDA支持需要NVIDIA Docker。想了解更多关于使用Lasagne Docker images 的细节,请参考源代码。