tensorflow-gpu安装脚本

相关文件下载:

https://pan.baidu.com/s/1EkmBzPtprn-aiE0ogVyHpQ

 

#!/bin/bash
#tensorflow-gpu版本安装脚本


# 安装驱动
ubuntu-drivers devices
sudo apt-get install nvidia-driver-435
sudo reboot

# 安装 cuda-10.1
chmod +x cuda_10.1.105_418.39_linux.run
sudo ./cuda_10.1.105_418.39_linux.run

# 安装cudnn
tar xzf cudnn-10.1-linux-x64-v7.6.4.38.tgz
sudo cp cuda/include/* /usr/local/cuda-10.1/include/
sudo cp cuda/lib64/* /usr/local/cuda-10.1/lib64/

# 环境变量设置
echo 'export  PATH=/usr/local/cuda-10.1/bin:$PATH' >> /etc/profile
source /etc/profile
ldconfig

#安装 TensorRT
tar xzvf TensorRT-6.0.1.5.Ubuntu-18.04.x86_64-gnu.cuda-10.1.cudnn7.6.tar.gz

cd TensorRT-6.0.1.5/python
sudo pip3 install tensorrt-6.0.1.5-cp36-none-linux_x86_64.whl

#安装UFF
cd ../uff
sudo pip3 install uff-0.6.5-py2.py3-none-any.whl

#安装graphsurgeon
cd ../graphsurgeon
sudo pip3 install graphsurgeon-0.4.1-py2.py3-none-any.whl

#配置环境变量
cd ../
sudo sh -c "echo $(pwd)/TensorRT-6.0.1.5/lib>/etc/ld.so.conf.d/TensorRT.conf"
sudo ldconfig

  

你可能感兴趣的