安装paddleOCR GPU环境+SD环境

安装paddleOCR GPU环境+SD环境

一 环境准备

安装paddleOCR GPU环境+SD环境-平凡之路

autoDL算力平台

​ 租用一个实例: Linux(centos8) + pytorch 2.1 镜像( 含CUDA 12版本, 含miniconda)

​ 系统盘: 20G

环境检测:

# 检查python 版本, 默认应该是3.8版本
python -V
# 检查PIP 版本
pip -V
# 升级 PIP, 升级后再检查pip 版本
python -m pip install --upgrade pip

相关检查结果:

root@autodl-container-205311a53c-7e47c76e:~# cd autodl-tmp
root@autodl-container-205311a53c-7e47c76e:~/autodl-tmp# ll
total 4
drwxr-xr-x 3 root root   29 Jan 13 17:48 ./
drwx------ 1 root root 4096 Jan 13 18:08 ../
drwxr-xr-x 2 root root   75 Jan 14 11:31 .autodl/
root@autodl-container-205311a53c-7e47c76e:~/autodl-tmp# conda --version
conda 23.5.0
root@autodl-container-205311a53c-7e47c76e:~/autodl-tmp# python -V
Python 3.10.6
root@autodl-container-205311a53c-7e47c76e:~/autodl-tmp# pip -V
pip 23.1.2 from /root/miniconda3/lib/python3.10/site-packages/pip (python 3.10)
root@autodl-container-205311a53c-7e47c76e:~/autodl-tmp# 

二 创建虚拟环境

登录autodl终端

ssh -p 50356 root@region-3.seetacloud.com / h/uRgPUn2Bjf

因为paddle并不是很大, 可以直接在系统盘中安装

# 创建一个python3.10版本的虚拟环境, 指定特定的目录
conda create --prefix /root/autodl-tmp/paddle/env/paddleocr python=3.10
# 激活安装环境
conda activate /root/autodl-tmp/paddle/env/paddleocr
# conda deactivate paddleocr

# 删除一个的虚拟环境
conda env remove --name paddleocr
# 或者直接删除目录
rm -rf /root/autodl-tmp/paddle/env/paddleocr

三 安装

Install PaddlePaddle

  • If you have CUDA 9 or CUDA 10 installed on your machine, please run the following command to install

    python -m pip install paddlepaddle-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple
    
  • If you have no available GPU on your machine, please run the following command to install the CPU version

    python -m pip install paddlepaddle -i https://pypi.tuna.tsinghua.edu.cn/simple
    

For more software version requirements, please refer to the instructions in Installation Document for operation.

1.2 Install PaddleOCR Whl Package

pip install "paddleocr>=2.0.1" # Recommend to use version 2.0.1+
  • For windows users: If you getting this error OSError: [WinError 126] The specified module could not be found when you install shapely on windows. Please try to download Shapely whl file here.

    Reference: Solve shapely installation on windows

附件: 参考资料

GitHub - YongJie-Xie/PaddleocrAPI: 由 FastAPI 包装的 Paddleocr 文本识别接口

PaddleOCR史上最全安装教程 - 知乎 (zhihu.com)

PaddleOCR/doc/doc_en/quickstart_en.md at release/2.7 · PaddlePaddle/PaddleOCR · GitHub

【官方】十分钟掌握PaddleOCR使用 - 飞桨AI Studio星河社区 (baidu.com)

训练Stable Diffusion(SD) Lora模型巨详细教程 赛博丹炉/青龙脚本/秋叶云端使用教程 主用赛博丹炉(道玄)巨小白巨啰嗦,全是干货和踩过的坑_赛博丹炉v1.4-CSDN博客