[Detectron2]: Ubuntu1604 配置Detectron2 cuda10.1 Driver418.56

Ubuntu1604 配置Detectron2 cuda10.1 Driver418.56

apt 安装 显卡驱动(最好禁用 nouveau) 以及CUDA安装

  1. 添加Graphic Drivers PPA

    sudo add-apt-repository ppa:graphics-drivers/ppa
    sudo apt-get update
    
  2. 寻找合适的驱动版本

        ubuntu-drivers devices
    
  3. 安装重启

    sudo apt install nvidia-
    sudo nvidia-smi
    sudo nvidia-settings
    
  4. 安装cudu

    去nvidia官网下载 .run文件

    sudo sh cuda_10.1.105_418.39_linux.run
    
  5. 配置环境变量

    export PATH=/usr/local/cuda-10.1/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH
    export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-10.1
    
  6. 安装cudnn

    下载cuDNN Library for Linux

    tar -xzvf cudnn-10.***.tgz
    sudo cp cuda/include/cudnn.h /usr/local/cuda/include
    sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
    sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
    
  7. 检查

    nvidia-smi
    nvcc -V
    

配置Detectron2环境

如果自己能力强看INSTALL.md,或者看Colab Notebook需科学上网

  1. 安装pytorch

    # install dependencies: (use cu101 because colab has CUDA 10.1)
    pip install -U torch==1.5 torchvision==0.6 -f https://download.pytorch.org/whl/cu101/torch_stable.html 
    pip install cython pyyaml==5.1
    pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
    
  2. 安装opencv

    pip install opencv-python
    
  3. 安装Detectron2

    1. 编译好了,对网有要求

      pip install detectron2==0.1.2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/index.html
      
    2. 从github下载编译

      git clone https://github.com/facebookresearch/detectron2.git
      python -m pip install -e detectron2
      

遇到的问题

遇到问题先去issue搜一下。

  1. assert get_version(fvcore, 3) >= (0, 1, 1), “Requires fvcore>=0.1.1”

    卸载fvcore,安装fvcore>=0.1.1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值