You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
运行页面https://gitee.com/paddlepaddle/PaddleOCR/blob/main/doc/doc_ch/quickstart.md#22 中的python脚本报错FatalError: Segmentation fault is detected by the operating system.
[TimeInfo: *** Aborted at 1717498950 (unix time) try "date -d @1717498950" if you are using GNU date ***]
[SignalInfo: *** SIGSEGV (@0x0) received by PID 4128 (TID 0x7fd9242d3740) from PID 0 ***]
ocr = PaddleOCR(use_angle_cls=True, lang='ch', use_gpu=True)
img_path = './ppocr_img/imgs/11.jpg'
result = ocr.ocr(img_path, cls=True)
for idx in range(len(result)):
res = result[idx]
for line in res:
print(line)
FatalError: Segmentation fault is detected by the operating system.
[TimeInfo: *** Aborted at 1717498950 (unix time) try "date -d @1717498950" if you are using GNU date ***]
[SignalInfo: *** SIGSEGV (@0x0) received by PID 4128 (TID 0x7fd9242d3740) from PID 0 ***]
问题描述 / Problem Description
运行页面https://gitee.com/paddlepaddle/PaddleOCR/blob/main/doc/doc_ch/quickstart.md#22 中的python脚本报错FatalError:
Segmentation fault
is detected by the operating system.[TimeInfo: *** Aborted at 1717498950 (unix time) try "date -d @1717498950" if you are using GNU date ***]
[SignalInfo: *** SIGSEGV (@0x0) received by PID 4128 (TID 0x7fd9242d3740) from PID 0 ***]
Segmentation fault (core dumped)
运行环境 / Runtime Environment
复现代码 / Reproduction Code
from paddleocr import PaddleOCR, draw_ocr
ocr = PaddleOCR(use_angle_cls=True, lang='ch', use_gpu=True)
img_path = './ppocr_img/imgs/11.jpg'
result = ocr.ocr(img_path, cls=True)
for idx in range(len(result)):
res = result[idx]
for line in res:
print(line)
完整报错 / Complete Error Message
[2024/06/04 11:02:29] ppocr DEBUG: Namespace(alpha=1.0, alphacolor=(255, 255, 255), benchmark=False, beta=1.0, binarize=False, cls_batch_num=6, cls_image_shape='3, 48, 192', cls_model_dir='/root/.paddleocr/whl/cls/ch_ppocr_mobile_v2.0_cls_infer', cls_thresh=0.9, cpu_threads=10, crop_res_save_dir='./output', det=True, det_algorithm='DB', det_box_type='quad', det_db_box_thresh=0.6, det_db_score_mode='fast', det_db_thresh=0.3, det_db_unclip_ratio=1.5, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_east_score_thresh=0.8, det_limit_side_len=960, det_limit_type='max', det_model_dir='/root/.paddleocr/whl/det_server/ch/ch_PP-OCRv4_det_server_infer', det_pse_box_thresh=0.85, det_pse_min_area=16, det_pse_scale=1, det_pse_thresh=0, det_sast_nms_thresh=0.2, det_sast_score_thresh=0.5, draw_img_save_dir='./inference_results', drop_score=0.5, e2e_algorithm='PGNet', e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_limit_side_len=768, e2e_limit_type='max', e2e_model_dir=None, e2e_pgnet_mode='fast', e2e_pgnet_score_thresh=0.5, e2e_pgnet_valid_set='totaltext', enable_mkldnn=False, fourier_degree=5, gpu_id=0, gpu_mem=500, help='==SUPPRESS==', image_dir=None, image_orientation=False, invert=False, ir_optim=True, kie_algorithm='LayoutXLM', label_list=['0', '180'], lang='ch', layout=True, layout_dict_path=None, layout_model_dir=None, layout_nms_threshold=0.5, layout_score_threshold=0.5, max_batch_size=10, max_text_length=25, merge_no_span_structure=True, min_subgraph_size=15, mode='structure', ocr=True, ocr_order_method=None, ocr_version='PP-OCRv4', output='./output', page_num=0, precision='fp32', process_id=0, re_model_dir=None, rec=True, rec_algorithm='SVTR_LCNet', rec_batch_num=6, rec_char_dict_path='/opt/PaddleOCR-main/ppocr/utils/ppocr_keys_v1.txt', rec_image_inverse=True, rec_image_shape='3, 48, 320', rec_model_dir='/root/.paddleocr/whl/rec_server/ch/ch_PP-OCRv4_rec_server_infer', recovery=False, return_word_box=False, save_crop_res=False, save_log_path='./log_output/', savefile=False, scales=[8, 16, 32], ser_dict_path='../train_data/XFUND/class_list_xfun.txt', ser_model_dir=None, show_log=True, sr_batch_num=1, sr_image_shape='3, 32, 128', sr_model_dir=None, structure_version='PP-StructureV2', table=True, table_algorithm='TableAttn', table_char_dict_path=None, table_max_len=488, table_model_dir=None, total_process_num=1, type='ocr', use_angle_cls=True, use_dilation=False, use_gpu=True, use_mlu=False, use_mp=False, use_npu=False, use_onnx=False, use_pdf2docx_api=False, use_pdserving=False, use_space_char=True, use_tensorrt=False, use_visual_backbone=True, use_xpu=False, vis_font_path='./doc/fonts/simfang.ttf', warmup=False)
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
C++ Traceback (most recent call last):
0 paddle_infer::Predictor::Predictor(paddle::AnalysisConfig const&)
1 std::unique_ptr<paddle::PaddlePredictor, std::default_deletepaddle::PaddlePredictor > paddle::CreatePaddlePredictor<paddle::AnalysisConfig, (paddle::PaddleEngineKind)2>(paddle::AnalysisConfig const&)
2 paddle::AnalysisPredictor::Init(std::shared_ptrpaddle::framework::Scope const&, std::shared_ptrpaddle::framework::ProgramDesc const&)
3 paddle::AnalysisPredictor::PrepareProgram(std::shared_ptrpaddle::framework::ProgramDesc const&)
4 paddle::AnalysisPredictor::OptimizeInferenceProgram()
5 paddle::inference::analysis::Analyzer::RunAnalysis(paddle::inference::analysis::Argument*)
6 paddle::inference::analysis::IrAnalysisPass::RunImpl(paddle::inference::analysis::Argument*)
7 paddle::inference::analysis::IRPassManager::Apply(std::unique_ptr<paddle::framework::ir::Graph, std::default_deletepaddle::framework::ir::Graph >)
8 paddle::framework::ir::Pass::Apply(paddle::framework::ir::Graph*) const
9 paddle::framework::ir::ConvEltwiseAddBNFusePass::ApplyImpl(paddle::framework::ir::Graph*) const
10 paddle::framework::ir::GraphPatternDetector::operator()(paddle::framework::ir::Graph*, std::function<void (std::map<paddle::framework::ir::PDNode*, paddle::framework::ir::Node*, std::lesspaddle::framework::ir::PDNode*, std::allocator<std::pair<paddle::framework::ir::PDNode* const, paddle::framework::ir::Node*> > > const&, paddle::framework::ir::Graph*)>)
11 paddle::framework::LoDTensor* paddle::framework::Variable::GetMutablepaddle::framework::LoDTensor()
12 paddle::framework::SignalHandle(char const*, int)
13 paddle::platform::GetCurrentTraceBackStringabi:cxx11
Error Message Summary:
FatalError:
Segmentation fault
is detected by the operating system.[TimeInfo: *** Aborted at 1717498950 (unix time) try "date -d @1717498950" if you are using GNU date ***]
[SignalInfo: *** SIGSEGV (@0x0) received by PID 4128 (TID 0x7fd9242d3740) from PID 0 ***]
Segmentation fault (core dumped)
可能解决方案 / Possible solutions
刚开始安装了cuda11.3,后来发现cuda版本和paddlepaddle-gpu 版本不匹配后又安装了cuda11.2(做成了cuda多版本切换),仍然报错段错误。
另外,我的服务器因为特殊原因不连接互联网,以上所有都是离线安装。
附件 / Appendix
pip list显示docker内环境:
Package Version
aspy.yaml 1.3.0
astor 0.8.1
astroid 2.6.5
attrs 21.2.0
backports.entry-points-selectable 1.1.0
cached-property 1.5.2
certifi 2021.5.30
cfgv 3.3.0
charset-normalizer 2.0.4
cycler 0.11.0
decorator 5.0.9
distlib 0.3.2
filelock 3.0.12
gast 0.4.0
identify 2.2.11
idna 3.2
imageio 2.5.0
imgaug 0.4.0
importlib-metadata 4.6.3
iniconfig 1.1.1
ipykernel 4.6.0
ipython 5.3.0
ipython-genutils 0.2.0
isort 5.9.3
jupyter-client 6.1.12
jupyter-core 4.7.1
kiwisolver 1.1.0
lazy-object-proxy 1.6.0
lmdb 1.1.0
matplotlib 3.1.2
mccabe 0.6.1
networkx 2.6.2
nodeenv 1.6.0
numpy 1.17.0
opencv-python 3.4.10.35
packaging 21.0
paddlepaddle-gpu 2.1.3.post112
pexpect 4.8.0
pickleshare 0.7.5
Pillow 8.3.1
pip 20.0.1
platformdirs 2.2.0
pluggy 0.13.1
pre-commit 1.10.4
prompt-toolkit 1.0.18
protobuf 3.17.3
ptyprocess 0.7.0
py 1.10.0
pyclipper 1.3.0.post5
Pygments 2.9.0
pygobject 3.26.1
pylint 2.9.6
pyparsing 2.4.7
pytest 6.2.4
python-apt 1.6.5+ubuntu0.5
python-dateutil 2.8.2
PyWavelets 1.1.1
PyYAML 5.4.1
pyzmq 22.1.0
requests 2.26.0
scikit-image 0.19.3
scipy 1.4.1
setuptools 50.3.2
shapely 2.0.4
simplegeneric 0.8.1
six 1.16.0
tifffile 2019.7.26
toml 0.10.2
tornado 6.1
tqdm 4.62.0
traitlets 5.0.5
typed-ast 1.4.3
typing-extensions 3.10.0.0
unattended-upgrades 0.1
urllib3 1.26.6
virtualenv 20.7.0
wcwidth 0.2.5
wheel 0.36.2
wrapt 1.12.1
zipp 3.5.0
显卡情况:
两张3090
cuda版本:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Jan_28_19:32:09_PST_2021
Cuda compilation tools, release 11.2, V11.2.142
Build cuda_11.2.r11.2/compiler.29558016_0
The text was updated successfully, but these errors were encountered: