赞
踩
@Author:Runsen
文档: https://keras.io/getting-started/faq/#how-can-i-run-keras-on-gpu

首先,下载并安装CUDA&CuDNN(假设您使用的是NVIDIA gpu)
安装url: https://developer.nvidia.com/cudnn
然后,通过在cmd或terminal中键入以下命令来安装tensorflow gpu(启用gpu的tensorflow版本)
pip install tensorflow gpu
然后检查机器正在使用GPU设备
在下面例子中,我有一个GPU设备(其名称为“/device:GPU:0”)
如果使用的是Google Colab,只需将运行时类型更改为“GPU”
import tensorflow as tf
from tensorflowCopyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。