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


    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
     

  • 相关阅读:
    【 java 面向对象】java 设计模式之单例模式
    关键字 internal
    RPA要不要学习,真的能解放双手吗?
    Linux 中的 cp 命令及示例
    离散制造业生产域制造资源数据标准化及治理建设思路
    金仓数据库 MySQL 至 KingbaseES 迁移最佳实践(3. MySQL 数据库移植实战)
    Linux动静态库
    为什么 glBegin 未被定义 & 未定义的标识符,使用新的 API(LearnOpenGL P2)
    黑群晖从入门到入土,自编译适合自己硬件的黑群晖7.1.x引导(黑群晖DSM7.X引导用arpl编译教程)
    【无标题】
  • 原文地址:https://blog.csdn.net/qq_29707567/article/details/127609512