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

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
 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值