zoukankan      html  css  js  c++  java
  • 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
    
  • 相关阅读:
    LCA模板
    bzoj1660:[Usaco2006 Nov]badhair乱头发节
    不老的传说
    田忌赛马
    最短路径问题
    hdu2421-Deciphering Password-(欧拉筛+唯一分解定理+积性函数+立方求和公式)
    hdu1215-七夕节-(埃氏筛+唯一分解定理)
    迷宫-(bfs)
    区间或和-(位运算)
    海啸-(矩阵前缀和)
  • 原文地址:https://www.cnblogs.com/lwp-nicol/p/14944111.html
Copyright © 2011-2022 走看看