GPU云主机配置keras2Python3.6Tensorflow环境记录[20190402可用]

2018年5月17日 5733点热度 0人点赞 0条评论

python3.6
cudnn7.1.3
keras和tensorflow
graphviz
Opencv

 

 

阿里云 弗吉尼亚地区 ecs.gn5-c4g1.xlarge型号

OS:ubuntu 16.04

CPU: 4 vCPU

GPU: Nvidia P100 (12 GiB 显存)

 

安装python3

sudo apt-get install -y  software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python3.6

修改默认python为python3.6

移除软连接,建立新的软连接
rm -rf /usr/bin/python
ln -s /usr/bin/python3.6 /usr/bin/python
配置pip3为默认pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
pip install --upgrade pip

安装的CUDA

在https://developer.nvidia.com/cuda-toolkit-archive)下载CUDA9.0

(注意,官网下载链接是xxxxxxxxxxxxxxxxxx-deb,给的安装指导是xxxxxxxxxxxxxxxxxx.deb.你们注意区别)
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb

sudo dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb

sudo apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub

sudo apt-get update

sudo apt-get  install -y cuda

安装cudnn

下载cudnn

需要登录developer.nvidia.com。在https://developer.nvidia.com/rdp/cudnn-download 选择 cuDNN v7.1.3 Runtime Library for Ubuntu16.04 (Deb)

sudo dpkg -i libcudnn7_7.1.3.16-1+cuda9.0_amd64.deb

安装keras和tensorflow

pip install keras

pip install tensorflow_gpu

可视化工具安装

sudo apt-get install -y graphviz

pip install pydot

Opencv安装

pip install opencv-python

Dong Wang

Master student of computer science at Uppsala University in Sweden. My primary research interests are deep learning, computer vision, federated learning and internet-of-things.

文章评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据