• 量化环境搭建方法及过程中遇到的问题


    1.确定使用的基础镜像

    nvidia/cuda:11.8.0-cudnn8-devel-ubuntu18.04

    2.进入镜像【区别:第一次用的是基础镜像、第二次用的是装好包的镜像;区别2:第一次是映射进去一张卡,第二次是全部映射进去,2张卡都是NV的,实际使用的是第一张卡】

    docker run --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=1  --name test1 -v /mnt:/mnt  -it nvidia/cuda:11.8.0-cudnn8-devel-ubuntu18.04 /bin/bash

    docker run --gpus all   --name test2 -v /mnt:/mnt  -it quant_from_zl:zl1021-v2 /bin/bash

    3、安装包
    apt-get update
    apt install curl -y
    curl -O https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
    bash Anaconda3-2021.05-Linux-x86_64.sh 
    source ~/.bashrc
    apt-get install -y ssh
    apt-get install sshpass
    apt install libgl1-mesa-glx
    apt install cmake -y
    apt-get install libglib2.0-dev -y

    conda create -n python3.9.12 python=3.9.12
    source activate python3.9.12
    pip install onnx==1.10.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install onnxruntime==1.12.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install opencv-python==4.5.4.58 -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install tqdm==4.62.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install values -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install pycocotools -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install Ninja -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip3 install --upgrade protobuf==3.20.1
    pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu117
    pip install terminaltables -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install tensorflow==2.10.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install imageio -i https://pypi.tuna.tsinghua.edu.cn/simple

    4.可能遇到的问题

    ######错误问题1
    If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
    If you cannot immediately regenerate your protos, some other possible workarounds are:
     1. Downgrade the protobuf package to 3.20.x or lower.
     2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

    解决办法:https://blog.csdn.net/iningwei/article/details/127201081
    pip3 install --upgrade protobuf==3.20.1


    ####错误问题2
    RuntimeError: CUDA error: no kernel image is available for execution on the device

    ####错误问题3
    No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
    export FORCE_CUDA="1"
    pip uninstall torch

    pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu117
     

  • 相关阅读:
    Android SIM卡识别加载流程
    安科瑞高等学校校园建筑节能监管系统建设
    Oracle/PLSQL: Covar_pop Function
    数字孪生|成熟度等级
    Centos8安装配置jenkins
    DNS工作原理分析
    带上ES一起寻找理想的另一半
    解决新版 Kali Linux 在 VMware 虚拟机中设置共享文件夹后依旧寻找不到的问题
    【英语:基础高阶_全场景覆盖表达】K10.口语主题陈述——地点类
    Python+AI智能编辑人脸
  • 原文地址:https://blog.csdn.net/qq_29707567/article/details/127609512