• conda安装


    conda安装

    安装miniconda

    • 安装的时候勾选 add to path

    conda添加源

    #查看当前conda配置
    conda config --show channels
     
    #设置通道
    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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
     
    #设置搜索是显示通道地址
    conda config --set show_channel_urls yes
     
    conda install pytorch torchvision cudatoolkit=10.0  # 删除安装命令最后的 -c pytorch,才会采用清华源安装。
    

    创建python虚拟环境

    conda create --name py36 python=3.6 
    

    安装相关package

    安装pytorch

    • pytorch-cpu版本
      1. 采用本地安装的方法,百度网盘下载pytorch.xx.whl和torchvision.xx.whl
      2. pip install torch-1.2.0+cpu-cp36-cp36m-win_amd64.whl
      3. pip install torchvision-0.4.0+cpu-cp36-cp36m-win_amd64.whl

    安装matplotlib

    • pip install matplotlib

    安装opencv

    • pip install opencv-python

    更改pip清华镜像

    • Windows下:
      【C:Users你的用户名】目录下,新建pip文件夹,进到文件夹中创建pip.ini文件,然后打开它,将下面代码粘贴进去-->保存
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    [install]
    trusted-host = https://pypi.tuna.tsinghua.edu.cn
    
    • Ubuntu下:
      创建pip.config 文件
    mkdir ~/.pip
    vim ~/.pip/pip.conf
    

    添加pip源

    [global]
    trusted-host =  pypi.mirrors.ustc.edu.cn
    index-url = https://pypi.mirrors.ustc.edu.cn/simple
    
  • 相关阅读:
    基于Dubbo的压测调优实例
    R语言之Apriori算法应用
    Linux中的用户和组
    R语言中的循环及其扩展:iter和foreach
    R在Windows下连接Oracle数据库
    R语言之机器学习程序包(更新)
    R语言之数据结构
    windows环境下node安装教程(超详细)
    windows环境下elasticsearch安装教程(超详细)
    MongoDB分片介绍
  • 原文地址:https://www.cnblogs.com/lwp-nicol/p/14944111.html
Copyright © 2020-2023  润新知