首页 PaddleOCR 帖子详情
paddleOCR 使用CPU正常,使用GPU无法解析
收藏
快速回复
PaddleOCR 其他OCR 1361 1
paddleOCR 使用CPU正常,使用GPU无法解析
收藏
快速回复
PaddleOCR 其他OCR 1361 1

PS D:\backend\OCR\PaddleOCR\PaddleOCR-release-2.6> python .\bmfenxi.py
D:\OCR\Anaconda3\lib\site-packages\urllib3\util\selectors.py:14: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import namedtuple, Mapping
D:\OCR\Anaconda3\lib\site-packages\urllib3\_collections.py:2: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import Mapping, MutableMapping
D:\OCR\Anaconda3\lib\site-packages\skimage\util\dtype.py:27: DeprecationWarning: `np.bool8` is a deprecated alias for `np.bool_`. (Deprecated NumPy 1.24)
np.bool8: (False, True),
[2023/04/10 10:49:52] ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=False, use_xpu=False, use_npu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, precision='fp32', gpu_mem=500, gpu_id=0, image_dir=None, page_num=0, det_algorithm='DB', det_model_dir='C:\\Users\\carcredit/.paddleocr/whl\\det\\ch\\ch_PP-OCRv3_det_infer', det_limit_side_len=960, det_limit_type='max', det_box_type='quad', det_db_thresh=0.3, det_db_box_thresh=0.6, det_db_unclip_ratio=1.5, max_batch_size=10, use_dilation=False, det_db_score_mode='fast', det_east_score_thresh=0.8, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_sast_score_thresh=0.5, det_sast_nms_thresh=0.2, det_pse_thresh=0, det_pse_box_thresh=0.85, det_pse_min_area=16, det_pse_scale=1, scales=[8, 16, 32], alpha=1.0, beta=1.0, fourier_degree=5, rec_algorithm='SVTR_LCNet', rec_model_dir='C:\\Users\\carcredit/.paddleocr/whl\\rec\\ch\\ch_PP-OCRv3_rec_infer', rec_image_inverse=True, rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='D:\\backend\\OCR\\PaddleOCR\\PaddleOCR-release-2.6\\ppocr\\utils\\ppocr_keys_v1.txt', use_space_char=True, vis_font_path='./doc/fonts/simfang.ttf', drop_score=0.5, e2e_algorithm='PGNet', e2e_model_dir=None, e2e_limit_side_len=768, e2e_limit_type='max', e2e_pgnet_score_thresh=0.5, e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_pgnet_valid_set='totaltext',
e2e_pgnet_mode='fast', use_angle_cls=True, cls_model_dir='C:\\Users\\carcredit/.paddleocr/whl\\cls\\ch_ppocr_mobile_v2.0_cls_infer', cls_image_shape='3, 48, 192', label_list=['0', '180'], cls_batch_num=6, cls_thresh=0.9, enable_mkldnn=False, cpu_threads=10, use_pdserving=False, warmup=False, sr_model_dir=None, sr_image_shape='3, 32, 128', sr_batch_num=1, draw_img_save_dir='./inference_results', save_crop_res=False, crop_res_save_dir='./output', use_mp=False, total_process_num=1, process_id=0, benchmark=False, save_log_path='./log_output/', show_log=True, use_onnx=False, output='./output', table_max_len=488, table_algorithm='TableAttn', table_model_dir=None, merge_no_span_structure=True, table_char_dict_path=None, layout_model_dir=None, layout_dict_path=None, layout_score_threshold=0.5, layout_nms_threshold=0.5, kie_algorithm='LayoutXLM', ser_model_dir=None, re_model_dir=None, use_visual_backbone=True, ser_dict_path='../train_data/XFUND/class_list_xfun.txt', ocr_order_method=None, mode='structure', image_orientation=False, layout=True, table=True, ocr=True, recovery=False, use_pdf2docx_api=False, lang='ch', det=True, rec=True, type='ocr', ocr_version='PP-OCRv3', structure_version='PP-StructureV2')
stime: 2023-04-10 10:49:53
[2023/04/10 10:49:53] ppocr DEBUG: dt_boxes num : 12, elapse : 0.60341477394104
[2023/04/10 10:49:54] ppocr DEBUG: cls num : 12, elapse : 0.15156340599060059
[2023/04/10 10:49:55] ppocr DEBUG: rec_res num : 12, elapse : 1.6141126155853271
[[[[2928.0, 1080.0], [3029.0, 1081.0], [3019.0, 2155.0], [2918.0, 2154.0]], ('370920197109254961', 0.9284619092941284)], [[[2549.0, 1610.0], [2636.0, 1611.0], [2625.0, 2430.0], [2539.0, 2429.0]], ('山东省新泰市新汶办事处', 0.9855737090110779)], [[[2650.0, 1625.0], [2736.0, 1626.0], [2726.0, 2430.0], [2640.0, 2429.0]], ('汶中路48号20号楼2单元', 0.8931759595870972)], [[[2410.0, 1787.0], [2448.0, 1787.0], [2448.0, 1841.0], [2410.0, 1841.0]], ('工', 0.905320942401886)], [[[2382.0, 1820.0], [2482.0, 1823.0], [2466.0, 2426.0], [2366.0, 2423.0]], ('1971年9月25日', 0.8950810432434082)], [[[2243.0, 1938.0], [2329.0, 1942.0], [2317.0, 2225.0], [2231.0, 2221.0]], ('民族汉', 0.9953923225402832)], [[[2064.0, 2140.0], [2170.0, 2140.0], [2170.0, 2430.0], [2064.0, 2430.0]], ('曹丙芬', 0.9978397488594055)], [[[2928.0, 2204.0], [3010.0, 2204.0], [3010.0, 2656.0], [2928.0, 2656.0]], ('公民身份号码', 0.974541187286377)], [[[2760.0, 2219.0], [2827.0, 2219.0], [2827.0, 2425.0], [2760.0, 2425.0]], ('601室', 0.9750556349754333)], [[[2246.0, 2337.0], [2309.0, 2337.0], [2309.0, 2415.0], [2246.0, 2415.0]], ('女', 0.9811893701553345)], [[[2083.0, 2435.0], [2155.0, 2435.0], [2155.0, 2656.0], [2083.0, 2656.0]], ('姓名', 0.9921202063560486)]]

以上是 ocr = PaddleOCR(use_angle_cls=True, lang="ch", use_gpu=False)     未启动GPU 使用 CPU版本的结果。可以正常解析

以下是 ocr = PaddleOCR(use_angle_cls=True, lang="ch", use_gpu=True)    使用 CPU版本的结果。  但是无法正常解析

PS D:\backend\OCR\PaddleOCR\PaddleOCR-release-2.6> python .\bmfenxi.py
D:\OCR\Anaconda3\lib\site-packages\urllib3\util\selectors.py:14: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import namedtuple, Mapping
D:\OCR\Anaconda3\lib\site-packages\urllib3\_collections.py:2: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import Mapping, MutableMapping
D:\OCR\Anaconda3\lib\site-packages\skimage\util\dtype.py:27: DeprecationWarning: `np.bool8` is a deprecated alias for `np.bool_`. (Deprecated NumPy 1.24)
np.bool8: (False, True),
[2023/04/10 10:52:15] ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=True, use_xpu=False, use_npu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, precision='fp32', gpu_mem=500, gpu_id=0, image_dir=None, page_num=0, det_algorithm='DB', det_model_dir='C:\\Users\\carcredit/.paddleocr/whl\\det\\ch\\ch_PP-OCRv3_det_infer', det_limit_side_len=960, det_limit_type='max', det_box_type='quad', det_db_thresh=0.3, det_db_box_thresh=0.6, det_db_unclip_ratio=1.5, max_batch_size=10, use_dilation=False, det_db_score_mode='fast', det_east_score_thresh=0.8, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_sast_score_thresh=0.5, det_sast_nms_thresh=0.2, det_pse_thresh=0, det_pse_box_thresh=0.85, det_pse_min_area=16, det_pse_scale=1, scales=[8, 16, 32], alpha=1.0, beta=1.0, fourier_degree=5, rec_algorithm='SVTR_LCNet', rec_model_dir='C:\\Users\\carcredit/.paddleocr/whl\\rec\\ch\\ch_PP-OCRv3_rec_infer', rec_image_inverse=True, rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='D:\\backend\\OCR\\PaddleOCR\\PaddleOCR-release-2.6\\ppocr\\utils\\ppocr_keys_v1.txt', use_space_char=True, vis_font_path='./doc/fonts/simfang.ttf', drop_score=0.5, e2e_algorithm='PGNet', e2e_model_dir=None, e2e_limit_side_len=768, e2e_limit_type='max', e2e_pgnet_score_thresh=0.5, e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_pgnet_valid_set='totaltext', e2e_pgnet_mode='fast', use_angle_cls=True, cls_model_dir='C:\\Users\\carcredit/.paddleocr/whl\\cls\\ch_ppocr_mobile_v2.0_cls_infer', cls_image_shape='3, 48, 192', label_list=['0', '180'], cls_batch_num=6, cls_thresh=0.9, enable_mkldnn=False, cpu_threads=10, use_pdserving=False, warmup=False, sr_model_dir=None, sr_image_shape='3, 32, 128', sr_batch_num=1, draw_img_save_dir='./inference_results', save_crop_res=False, crop_res_save_dir='./output', use_mp=False, total_process_num=1, process_id=0, benchmark=False, save_log_path='./log_output/', show_log=True, use_onnx=False, output='./output', table_max_len=488, table_algorithm='TableAttn', table_model_dir=None, merge_no_span_structure=True, table_char_dict_path=None, layout_model_dir=None, layout_dict_path=None, layout_score_threshold=0.5, layout_nms_threshold=0.5, kie_algorithm='LayoutXLM', ser_model_dir=None, re_model_dir=None, use_visual_backbone=True, ser_dict_path='../train_data/XFUND/class_list_xfun.txt', ocr_order_method=None, mode='structure', image_orientation=False, layout=True,
table=True, ocr=True, recovery=False, use_pdf2docx_api=False, lang='ch', det=True, rec=True, type='ocr', ocr_version='PP-OCRv3', structure_version='PP-StructureV2')
stime: 2023-04-10 10:52:19
[2023/04/10 10:52:20] ppocr DEBUG: dt_boxes num : 1, elapse : 1.2433769702911377
[2023/04/10 10:52:20] ppocr DEBUG: cls num : 1, elapse : 0.05981111526489258
[2023/04/10 10:52:20] ppocr DEBUG: rec_res num : 1, elapse : 0.08676695823669434
[[[[0.0, 1865.0], [4607.0, 1865.0], [4607.0, 2882.0], [0.0, 2882.0]], ("仅處币砂撑汕亨月妮粱”这涌乏添凝閑孚著+Z丶#询廳赶丫公锈'慶下输μ婆", 0.9999997615814209)]]

 

代码部分 - 如下:

ocr = PaddleOCR(use_angle_cls=True, lang="ch", use_gpu=True)
img_path = 'D:/tmp/曹丙芬_承租人身份证正面_1348631.jpg'

stime = datetime.datetime.now()
print("stime: " + stime.strftime("%Y-%m-%d %H:%M:%S"))
result = ocr.ocr(img_path)
for line in result:
    print(line)

 

PS D:\backend\OCR\PaddleOCR\PaddleOCR-release-2.6> python -m pip list
WARNING: Ignoring invalid distribution -addlepaddle (d:\ocr\anaconda3\lib\site-packages)
Package Version
----------------------------- --------------------
aiofiles 23.1.0
aiohttp 3.8.4
aiosignal 1.3.1
alabaster 0.7.12
albumentations 1.3.0
aliyun-python-sdk-core 2.13.36
aliyun-python-sdk-kms 2.16.0
altair 4.2.2
anaconda-client 1.11.0
anaconda-navigator 2.3.1
anaconda-project 0.11.1
anyio 3.5.0
appdirs 1.4.4
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
arrow 1.2.2
astor 0.8.1
astroid 2.11.7
astropy 5.1
async-timeout 4.0.2
atomicwrites 1.4.0
attrdict 2.0.1
attrs 21.4.0
Automat 20.2.0
autopep8 1.6.0
Babel 2.11.0
backcall 0.2.0
backports.functools-lru-cache 1.6.4
backports.tempfile 1.0
backports.weakref 1.0.post1
bce-python-sdk 0.8.79
bcrypt 3.2.0
beautifulsoup4 4.11.1
binaryornot 0.4.4
bitarray 2.5.1
bkcharts 0.2
black 22.6.0
bleach 4.1.0
bokeh 2.4.3
boto3 1.24.28
botocore 1.27.28
bottle 0.12.23
Bottleneck 1.3.5
Brotli 1.0.9
brotlipy 0.7.0
cachetools 5.3.0
certifi 2022.9.14
cffi 1.15.1
chardet 3.0.4
charset-normalizer 2.0.4
click 8.0.4
cloudpickle 2.0.0
clyent 1.2.2
colorama 0.4.5
colorcet 3.0.0
coloredlogs 15.0.1
common 0.1.2
comtypes 1.1.10
conda 23.1.0
conda-build 3.22.0
conda-content-trust 0.1.3
conda-pack 0.6.0
conda-package-handling 1.9.0
conda-repo-cli 1.0.20
conda-token 0.4.0
conda-verify 3.4.2
constantly 15.1.0
cookiecutter 1.7.3
crcmod 1.7
cryptography 37.0.1
cssselect 1.1.0
cssutils 2.6.0
cycler 0.11.0
Cython 0.29.32
cytoolz 0.11.0
daal4py 2021.6.0
dask 2022.7.0
data 0.4
datashader 0.14.1
datashape 0.5.4
debugpy 1.5.1
decorator 5.1.1
defusedxml 0.7.1
diff-match-patch 20200713
dill 0.3.6
distlib 0.3.6
distributed 2022.7.0
docutils 0.18.1
dual 0.0.10
dynamo3 0.4.10
easydict 1.10
entrypoints 0.4
et-xmlfile 1.1.0
ExifRead 3.0.0
fastapi 0.91.0
fastjsonschema 2.16.2
ffmpy 0.3.0
filelock 3.6.0
fire 0.5.0
flake8 4.0.1
Flask 2.2.2
flask-babel 3.0.1
flatbuffers 23.3.3
flywheel 0.5.4
fonttools 4.25.0
frozenlist 1.3.3
fsspec 2022.7.1
funcsigs 1.0.2
future 0.18.2
gensim 4.1.2
gevent 22.10.2
geventhttpclient 2.0.2
glob2 0.7
gradio 3.18.0
graphviz 0.8.4
greenlet 2.0.2
grpcio 1.51.1
h11 0.14.0
h5py 3.7.0
HeapDict 1.0.1
holoviews 1.15.0
httpcore 0.16.3
httpx 0.23.3
humanfriendly 10.0
hvplot 0.8.0
hyperlink 21.0.0
idna 2.6
imagecodecs 2021.8.26
imageio 2.19.3
imagesize 1.4.1
imgaug 0.4.0
importlib-metadata 4.11.3
incremental 21.3.0
inflection 0.5.1
iniconfig 1.1.1
insightface 0.7.2
intake 0.6.5
intervaltree 3.1.0
iopath 0.1.10
ipykernel 6.15.2
ipython 7.31.1
ipython-genutils 0.2.0
ipywidgets 7.6.5
isort 5.9.3
itemadapter 0.3.0
itemloaders 1.0.4
itsdangerous 2.0.1
jdcal 1.4.1
jedi 0.18.1
jellyfish 0.9.0
Jinja2 3.1.2
jinja2-time 0.2.0
jmespath 0.10.0
joblib 1.1.0
json5 0.9.6
jsonschema 4.16.0
jupyter 1.0.0
jupyter_client 7.3.4
jupyter-console 6.4.3
jupyter_core 4.11.1
jupyter-server 1.18.1
jupyterlab 3.4.4
jupyterlab-pygments 0.1.2
jupyterlab-server 2.10.3
jupyterlab-widgets 1.0.0
keyring 23.4.0
kiwisolver 1.4.2
lanms-neo 1.0.2
layoutparser 0.0.0
lazy-object-proxy 1.6.0
libarchive-c 2.9
linkify-it-py 1.0.3
llvmlite 0.38.0
lmdb 1.2.1
locket 1.0.0
lxml 4.9.1
lz4 3.1.3
Markdown 3.3.4
markdown-it-py 2.1.0
MarkupSafe 2.1.2
matplotlib 3.5.2
matplotlib-inline 0.1.6
mccabe 0.6.1
mdit-py-plugins 0.3.3
mdurl 0.1.2
menuinst 1.4.19
mistune 0.8.4
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
mock 4.0.3
mpmath 1.2.1
msgpack 1.0.3
multidict 6.0.4
multipledispatch 0.6.0
multiprocess 0.70.14
munkres 1.1.4
mxnet 1.7.0.post2
mypy-extensions 0.4.3
mysql-connector-python 8.0.32
named 1.1.0
navigator-updater 0.3.0
nbclassic 0.3.5
nbclient 0.5.13
nbconvert 6.4.4
nbformat 5.5.0
nest-asyncio 1.5.5
networkx 2.8.4
nltk 3.7
nose 1.3.7
notebook 6.4.12
numba 0.55.1
numexpr 2.8.3
numpy 1.24.2
numpydoc 1.4.0
olefile 0.46
onnx 1.10.0
onnxruntime 1.14.1
opencv-contrib-python 4.6.0.66
opencv-python 4.6.0.66
opencv-python-headless 4.7.0.72
openpyxl 3.0.10
opt-einsum 3.3.0
orjson 3.8.6
oss2 2.17.0
packaging 21.3
paddle 1.0.2
paddle-bfloat 0.1.7
paddle2onnx 1.0.6
paddleocr 2.6.1.3
paddlepaddle-gpu 2.4.2.post117
pandas 1.4.4
pandocfilters 1.5.0
panel 0.13.1
param 1.12.0
paramiko 2.8.1
parsel 1.6.0
parso 0.8.3
partd 1.2.0
pathlib 1.0.1
pathspec 0.9.0
patsy 0.5.2
pdf2docx 0.5.6
peewee 3.15.4
pep8 1.7.1
pexpect 4.8.0
pickleshare 0.7.5
Pillow 9.2.0
pip 22.2.2
pkginfo 1.8.2
platformdirs 2.5.2
plotly 5.9.0
pluggy 1.0.0
Polygon3 3.0.9.1
portalocker 2.7.0
poyo 0.5.0
premailer 3.10.0
prettytable 3.6.0
prometheus-client 0.14.1
prompt-toolkit 3.0.20
Protego 0.1.16
protobuf 3.20.0
prox 0.0.17
psutil 5.9.0
ptyprocess 0.7.0
py 1.11.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pyclipper 1.3.0.post4
pycodestyle 2.8.0
pycosat 0.6.3
pycparser 2.21
pycryptodome 3.17
pyct 0.4.8
pycurl 7.45.1
pydantic 1.10.4
PyDispatcher 2.0.5
pydocstyle 6.1.1
pydub 0.25.1
pyerfa 2.0.0
pyflakes 2.4.0
Pygments 2.11.2
PyHamcrest 2.0.2
PyJWT 2.4.0
pylint 2.14.5
pyls-spyder 0.4.0
PyMuPDF 1.20.2
PyNaCl 1.5.0
pyodbc 4.0.34
pyOpenSSL 22.0.0
pyparsing 3.0.9
PyQt5 5.15.9
PyQt5-Qt5 5.15.2
PyQt5-sip 12.11.1
pyreadline3 3.4.1
pyrsistent 0.18.0
PySocks 1.7.1
pytest 7.1.2
python-dateutil 2.8.2
python-docx 0.8.11
python-geoip-python3 1.3
python-lsp-black 1.0.0
python-lsp-jsonrpc 1.0.0
python-lsp-server 1.3.3
python-multipart 0.0.5
python-rapidjson 1.9
python-slugify 5.0.2
python-snappy 0.6.0
pytz 2022.7.1
pyviz-comms 2.0.2
PyWavelets 1.3.0
pywin32 302
pywin32-ctypes 0.2.0
pywinpty 2.0.2
PyYAML 6.0
pyzmq 23.2.0
QDarkStyle 3.0.2
qstylizer 0.1.10
QtAwesome 1.0.3
qtconsole 5.2.2
QtPy 2.2.0
qudida 0.0.4
queuelib 1.5.0
rapidfuzz 2.13.7
rarfile 4.0
regex 2022.7.9
requests 2.28.2
requests-file 1.5.1
rfc3986 1.5.0
rope 0.22.0
Rtree 0.9.7
ruamel.yaml 0.17.21
ruamel.yaml.clib 0.2.6
ruamel-yaml-conda 0.15.100
s3transfer 0.6.0
scikit-image 0.19.2
scikit-learn 1.0.2
scikit-learn-intelex 2021.20221004.171935
scipy 1.9.1
Scrapy 2.6.2
seaborn 0.11.2
Send2Trash 1.8.0
service-identity 18.1.0
setuptools 63.4.1
Shapely 1.8.2
sip 4.19.13
six 1.16.0
sklearn 0.0.post1
smart-open 5.2.1
sniffio 1.2.0
snowballstemmer 2.2.0
sortedcollections 2.1.0
sortedcontainers 2.4.0
soupsieve 2.3.1
Sphinx 5.0.2
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
spyder 5.2.2
spyder-kernels 2.2.1
SQLAlchemy 1.4.39
starlette 0.24.0
statsmodels 0.13.2
sympy 1.10.1
tables 3.6.1
tabulate 0.8.10
TBB 0.2
tblib 1.7.0
tenacity 8.0.1
termcolor 2.2.0
terminado 0.13.1
testpath 0.6.0
text-unidecode 1.3
textdistance 4.2.1
threadpoolctl 2.2.0
three-merge 0.1.1
tifffile 2021.7.2
tight 0.1.0
tinycss 0.4
tldextract 3.2.0
toml 0.10.2
tomli 2.0.1
tomlkit 0.11.1
toolz 0.11.2
torch 2.0.0+cu118
torchaudio 2.0.1
torchvision 0.15.1
tornado 6.1
tqdm 4.64.1
traitlets 5.1.1
tritonclient 2.30.0
Twisted 22.2.0
twisted-iocpsupport 1.0.2
typing_extensions 4.3.0
uc-micro-py 1.0.1
ujson 5.4.0
Unidecode 1.2.0
urllib3 1.22
uvicorn 0.20.0
virtualenv 20.21.0
visualdl 2.5.0
w3lib 1.21.0
watchdog 2.1.6
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 0.58.0
websockets 10.4
Werkzeug 2.2.2
wheel 0.37.1
widgetsnbextension 3.5.2
win-inet-pton 1.1.0
win-unicode-console 0.5
wincertstore 0.2
wrapt 1.14.1
x2paddle 1.4.0
xarray 0.20.1
xlrd 1.2.0
XlsxWriter 3.0.3
xlwings 0.27.15
yapf 0.31.0
yarl 1.8.2
zict 2.1.0
zipp 3.8.0
zope.event 4.6
zope.interface 5.4.0

PS D:\backend\OCR\PaddleOCR\PaddleOCR-release-2.6> nvidia-smi
Mon Apr 10 10:56:47 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 516.94 Driver Version: 516.94 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... WDDM | 00000000:01:00.0 On | N/A |
| 40% 37C P8 1W / 38W | 553MiB / 1024MiB | 29% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1964 C+G ...y\ShellExperienceHost.exe N/A |
| 0 N/A N/A 5136 C+G ...ashCenter\FlashCenter.exe N/A |
| 0 N/A N/A 6628 C+G ...w5n1h2txyewy\SearchUI.exe N/A |
| 0 N/A N/A 7112 C+G ...wekyb3d8bbwe\Video.UI.exe N/A |
| 0 N/A N/A 9268 C+G C:\Windows\explorer.exe N/A |
| 0 N/A N/A 10216 C+G ...artMenuExperienceHost.exe N/A |
| 0 N/A N/A 10940 C+G ...se6\Application\360se.exe N/A |
| 0 N/A N/A 11288 C+G ...ekyb3d8bbwe\YourPhone.exe N/A |
| 0 N/A N/A 11468 C+G ...cw5n1h2txyewy\LockApp.exe N/A |
| 0 N/A N/A 13144 C+G ...perience\NVIDIA Share.exe N/A |
| 0 N/A N/A 15888 C+G ...4__8j3eq9eme6ctt\IGCC.exe N/A |
| 0 N/A N/A 16080 C+G ...es.TextInput.InputApp.exe N/A |
| 0 N/A N/A 16832 C+G ...me\Application\chrome.exe N/A |
| 0 N/A N/A 19864 C+G ...\QQLive\QQLiveService.exe N/A |
| 0 N/A N/A 21320 C+G ...lugins\FlutterPlugins.exe N/A |
| 0 N/A N/A 21348 C+G ...icrosoft VS Code\Code.exe N/A |
+-----------------------------------------------------------------------------+

测试部分代码如下

import torch
import paddle.fluid as fluid
import os
import matplotlib.pyplot as plt
from PIL import Image, ExifTags
import datetime
import paddle


print('paddle.is_compiled_with_cuda() ={}'.format(
    paddle.is_compiled_with_cuda()))

fluid.install_check.run_check()
paddle.utils.run_check()

x = torch.rand(5, 3)
print(x)


print(torch.__version__)

print(torch.cuda.is_available())  # 打印判断是否有GPU的结果
print(torch.cuda.device_count())  # 打印GPU的数量

 

输出结果如下:

D:\OCR\Anaconda3\lib\site-packages\urllib3\util\selectors.py:14: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import namedtuple, Mapping
D:\OCR\Anaconda3\lib\site-packages\urllib3\_collections.py:2: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import Mapping, MutableMapping
paddle.is_compiled_with_cuda() =True
Running Verify Fluid Program ...
W0410 10:57:18.877877 14160 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 5.0, Driver API Version: 11.7, Runtime API Version: 11.7
W0410 10:57:18.877877 14160 gpu_resources.cc:91] device: 0, cuDNN Version: 8.7.
Your Paddle Fluid works well on SINGLE GPU or CPU.
Your Paddle Fluid works well on MUTIPLE GPU or CPU.
Your Paddle Fluid is installed successfully! Let's start deep Learning with Paddle Fluid now
Running verify PaddlePaddle program ...
PaddlePaddle works well on 1 GPU.
PaddlePaddle works well on 1 GPUs.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
tensor([[0.1164, 0.1978, 0.4802],
[0.3806, 0.9015, 0.7516],
[0.6994, 0.0209, 0.5542],
[0.7616, 0.9248, 0.1220],
[0.2704, 0.9918, 0.7161]])
2.0.0+cu118
True
1

 

1
收藏
回复
全部评论(1)
时间顺序
L
Lyon615
#2 回复于2024-02

遇到同样的问题,解决了吗

 

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户