centos7、anconda、python3.8.6
1.创建anconda新虚拟环境
# python版本不宜太高
conda create -n paddle_env python=3.8.6
2.安装 paddlepaddle
CUDA9或CUDA10,运行以下命令安装
python3 -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple
没有GPU只有CPU,运行以下命令安装
python3 -m pip install paddlepaddle===2.4.2 -i https://mirror.baidu.com/pypi/simple
3.安装PaddleHub
python3 -m pip install paddleHub===2.3.1 -i https://mirror.baidu.com/pypi/simple
安装过程中如果报错没有找到setuptools_scm直接安装即可
python3 install setuptools_scm
4.安装PaddleOCR的服务器端高精度模型
https://www.paddlepaddle.org.cn/hubdetail?name=chinese_ocr_db_crnn_server
# 这里使用hub命令
hub install chinese_ocr_db_crnn_server
运行时报错:Can not import paddle core while this file exists
原因是缺少python环境的包,使用conda命令一起解决掉了
conda install