安装nvidia-docker
sudo docker run --runtime=nvidia --rm nvidia/cuda:9.0-base
查看是否安装成功
sudo nvidia-docker run --rm nvidia/cuda:9.0-base nvidia-smi
安装keras-gpu
https://store.docker.com/community/images/gw000/keras/tags
选择对应版本,这里选择2.1.4-py3-tf-gpu,注意下载要写全gw000/keras:2.1.4-py3-tf-gpu
下载命令
sudo docker pull gw000/keras:2.1.4-py3-tf-gpu
运行
sudo docker run -it --runtime=nvidia gw000/keras:2.1.4-py3-tf-gpu bash
sudo nvidia-docker run -it gw000/keras:2.1.4-py3-tf-gpu