在Keras中将cpu切换为gpu

在终端中输入gedit ~/.theanorc
这时文档应是空白的,在文档中写入:

[global]  
device=gpu  
floatX=float32 

[dnn.conv]
algo_bwd_filter = deterministic
algo_bwd_data = deterministic

[cuda]
root=/usr/local/cuda-8.0

[lib]
cnmem=0.3

[nvcc]
fastmath = True
optimizer_including=cudnn

参考:http://blog.csdn.net/sinat_31824577/article/details/53140406