Machine learning Theano support GPU在google Colab上不起作用

Machine learning Theano support GPU在google Colab上不起作用,machine-learning,gpu,theano,google-colaboratory,Machine Learning,Gpu,Theano,Google Colaboratory,我正在尝试训练一个基于Theano库的模型。由于我的电脑没有足够的内存来训练这个模型,我需要在谷歌Colab中进行训练。 但是我不能激活Theano的GPU支持 这就是我安装Theano和千层面的方式 !pip install --upgrade https://github.com/Theano/Theano/archive/master.zip !pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.z

我正在尝试训练一个基于Theano库的模型。由于我的电脑没有足够的内存来训练这个模型,我需要在谷歌Colab中进行训练。 但是我不能激活Theano的GPU支持

这就是我安装Theano和千层面的方式

!pip install --upgrade https://github.com/Theano/Theano/archive/master.zip
!pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip
下面是我尝试获得GPU支持的方法

import os
os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,device=cuda,floatX=float32"
import theano
print(theano.config.__getattribute__('device'))
我尝试使用anaconda升级pygpu,但Google Collab中没有安装anaconda

谢谢你的帮助

#install conda
!wget -c https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh

!chmod +x Anaconda3-5.1.0-Linux-x86_64.sh

!bash ./Anaconda3-5.1.0-Linux-x86_64.sh -b -f -p /usr/local

import sys

sys.path.append('/usr/local/lib/python3.6/site-packages/')

#install theano and pygpu
!conda install theano pygpu

您很乐意去…

希望它能解决问题,但请添加对代码的解释,以便用户能够完全理解他/她真正想要的。@Umme Aiman此解决方案不再适用于google colab。请您更新解决方案,并解释每一行。谢谢。
#install conda
!wget -c https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh

!chmod +x Anaconda3-5.1.0-Linux-x86_64.sh

!bash ./Anaconda3-5.1.0-Linux-x86_64.sh -b -f -p /usr/local

import sys

sys.path.append('/usr/local/lib/python3.6/site-packages/')

#install theano and pygpu
!conda install theano pygpu