环境搭建流程

准备工作

环境搭建

机器配置:i5-8300h, 1060 6G, 128G+1T, windows10 1909 家庭中文版

  1. 安装anaconda:官网下载exe安装
  2. 配置anaconda
# 创建环境py36
conda create -n py36 python=3.6
# 添加清华、中科大源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
# 进入py36环境
conda activate py36
  1. 配置环境
    由于项目较为古老,三年前的,所以安装库的版本不能太新,否则会有warning甚至无法运行
# 要求
Keras (>2.0.0)
Theano(>0.9) or Tensorflow(>1.1.x)
Numpy (>1.10)
Scipy (0.19.1)
OpenCV(>3.0)
Scikit-image (0.13.0)
PIL
# 安装tensorflow gpu (1.8.0)
## 查看感兴趣版本号
conda search tensorflow-gpu
## 安装1.8,anaconda自动安装相应版本cuda,cudnn
## 挂代理从anaconda默认网站下载,因为清华库中没有
conda install tensorflow-gpu=1.8.0
# 安装keras (2.2.0)
conda install keras-gpu=2.2.0
# 安装numpy(1.15)
conda install numpy=1.15
# 安装opencv(3.4.1)
conda install opencv=3.4.1
# 安装scipy, scikit-image, pillow,
conda install scipy, pillow, scikit-image
  1. 测试tensorflow-gpu是否正确安装:
import tensorflow as tf
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
 成功安装会显示GPU信息
import tensorflow as tf
a = tf.test.is_built_with_cuda()   #判断CUDA是否可用
b = tf.test.is_gpu_available(cuda_only=False,min_cuda_compute_capability=None)     #判断GPU是否可用
print(a)
print(b)
成功安装会两个true
  1. 补充说明
# 查看显卡信息(powershell)
cd C:\Program Files\NVIDIA Corporation\NVSMI\
.\nvidia-smi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值