keyfall / xuexibiji

3 stars 0 forks source link

训练ppocr bug总结 #72

Open keyfall opened 1 year ago

keyfall commented 1 year ago

使用cpu训练east检测模块显示需要安装lanms-neo,安装lanms-neo时又报错

image

主要原因是没有msvc和windows 10 sdk(我这里还安装了windows 11 sdk,我觉得对应windows版本就好) 下载vs_BuildTools.exe image image 安装完后重新安装lanms-neo就可以了 pip install lanms-neo==1.0.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

keyfall commented 1 year ago

安装paddleocr

安装anaconda3 anaconda3地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D image 创建虚拟环境命令 conda create --name paddle_env python=3.8 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

输入conda info找到envs地址 image 默认虚拟环境一般安装在envs列表的第一个 在文件夹中找到自己的虚拟环境文件夹(paddle_env)

pycharm中进行设置,python位置就写虚拟环境位置中的python.exe image

安装paddlepaddle cpu版本: python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple gpu版本: 飞桨官网安装文档

安装paddleocr(大于等于2.0.1就行) pip install paddleocr>=2.0.1

下载paddleocr源码后安装requirements pip install -r requirements.txt

启动训练模型命令: image

ch_PP-OCRv4_det_cml.yml这个是检测ppocrv4的模型 python tools\train.py -c configs\det\ch_PP-OCRv4\ch_PP-OCRv4_det_cml.yml det_r50_vd_east.yml 这个是检测模型(east) python tools\train.py -c configs\det\det_r50_vd_east.yml

keyfall commented 1 year ago

ubuntu22.04安装cuda和cudnn

keyfall commented 1 year ago

预测和训练只能跑一个 防止没有了,截个图 image

keyfall commented 1 year ago

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

apt install libgl1-mesa-glx

keyfall commented 1 year ago

docker使用gpu,镜像启动容器报错 解决:docker: Error response from daemon: could not select device driver ““ with capabilities: [[gpu]].

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
#更新
sudo apt update
#安装nvidia-container-toolkit
sudo apt install nvidia-container-toolkit
#重启
sudo systemctl restart docker