在Anaconda上安装Tensorflow-GPU+OpenCV包的步骤(全指令)

同时在Anaconda上使用Tensorlfow和OpenCV可能会出现一些版本问题,我把以前写的能够走得通的流程分享一下。

一、安装环境

Anaconda+CUDA10.0+CUDNN7.5.0;

二、配置Anaconda镜像源

直接打开控制台输入:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

注:创建新环境后如果出现HTTP0错误:

打开:
C:\Users<你的用户名> 下的.condarc
改成:

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
ssl_verify: true
show_channel_urls: true

三、创建新环境

打开控制台,依次输入以下指令:

conda create -n python36 python=3.6
activate python36
conda install tensorflow-gpu=1.13
conda install scikit-image
conda install matplotlib
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python

注:运行代码后出现 AttributeError: type object ‘h5py.h5r.Reference’ has no attribute ‘reduce_cython’ 错误:

这是h5py库版本不兼容引起的,输入以下指令即可:

activate python36
conda install h5py=2.8.0
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值