新装debian9系统和tensorflow-gpu==1.12

本文介绍了Debian9系统的安装与配置,包括替换源为阿里云、安装sudo、搜狗输入法等。还详细说明了在Debian9服务器上配置TensorFlow环境的步骤,如安装NVIDIA显卡驱动、CUDA、CUDNN等,同时提及了各软件版本对应关系及安装中的注意事项。

参考文章:(超完整)Linux(debian9)服务器配置tensorflow环境:nvidia驱动、CUDA、cudnn、anaconda

安装debian9

1、下载官方镜像,DVD版。
2、使用rufus-3.5制作安装U盘。注意是否需要UEFI选项。
3、语音现在英文,地区在other中选择中国。
4、选择软件xfce、ssh sever。

debian系统的配置

1、替换源为阿里云

mousepad /etc/apt/sources.list
deb http://mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free

2、安装sudo

#apt-get install sudo
mousepad /etc/sudoers

添加一行

"实际用户名" ALL=(ALL)ALL

3、安装搜狗输入法
a、搜狗官网下载.deb安装包
b、安装fcitx

sudo apt-get install fcitx

c、安装搜狗

sudo dpkg -i sougou*.deb

d、修复依赖关系

sudo apt --fix-broken install

e、重启桌面服务

sudo lightdm restart

f、配置fcitx config

4、安装NVIDIA显卡驱动
a、官网下载显卡驱动,例如,NVIDIA-Linux-x86_64-410.78.run
b、安装三大件

sudo apt-get install linux-headers-$(uname -r)
sudo apt-get install gcc
sudo apt-get install make

c、切换到命令行终端继续安装
ps:如果遇到命令行终端黑屏的情况,需要修改 GRUB为nomodeset

service lightdm stop
chmod +x NVIDIA-Linux-x86_64-410.78.run
./NVIDIA-Linux-x86_64-410.78.run

5、安装CUDA
a、官网下载CUDA,例如,cuda_9.0.176_384.81_linux-run,注意cuda版本和tensorflow版本的对应关系

sudo ./cuda_9.0.176_384.81_linux-run

b、在 /etc/profile添加两行路径

vim /etc/profile

在最后添加:

export PATH=/usr/local/cuda-9.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH

使路径生效:

source /etc/profile

6、安装CUDNN
a、下载CUDNN,例如,cudnn-9.0-linux-x64-v7.4.2.24.tgz
b、解压缩

tar -xvzf cudnn-9.0-linux-x64-v7.4.2.24.tgz

c、解压获得一个文件夹

cd cuda
sudo cp include/cudnn.h /usr/local/cuda/include
sudo cp lib64/libcudnn.* /usr/local/cuda/lib64

7、安装tensorflow
a、安装pip3

sudo apt-get install python3-pip

b、pip3安装tensorflow

pip3 install --user tensorflow-gpu==1.12 -i https://mirrors.aliyun.com/pypi/simple/
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值