Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

报错Illegal instruction is detected by the operating system #12072

Closed
Dong-star623 opened this issue May 8, 2024 · 4 comments
Closed

报错Illegal instruction is detected by the operating system #12072

Dong-star623 opened this issue May 8, 2024 · 4 comments
Assignees

Comments

@Dong-star623
Copy link

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
运行报错非法执行,部署是使用的conda方式,我同事的机器可以,但是我这台电脑报错非法执行,将他的虚拟机拷贝过来也是一样的报错,,我查询:cat /proc/cpuinfo |grep avx 是存在这个的.

  • 系统环境/System Environment:华为Eulor 2.0
  • 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:
    PaddlePaddle 2.6.1, compiled with
    with_avx: ON
    with_gpu: OFF
    with_mkl: ON
    with_mkldnn: ON
    with_python: ON

PaddleOCR:2.7.2版本

  • 运行指令/Command Code:
    paddleocr --image_dir /home/paddle/ppocr_img/imgs/11.jpg --use_angle_cls true --use_gpu false

  • 完整报错/Complete Error Message:


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::SelfAttentionFusePass::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*, paddle::framework::ir::GraphPatternDetector::PDNodeCompare, std::allocator<std::pair<paddle::framework::ir::PDNode* const, paddle::framework::ir::Node*> > > const&, paddle::framework::ir::Graph*)>)


Error Message Summary:

FatalError: Illegal instruction is detected by the operating system.
[TimeInfo: *** Aborted at 1715162027 (unix time) try "date -d @1715162027" if you are using GNU date ***]
[SignalInfo: *** SIGILL (@0x7f2da36b101a) received by PID 24392 (TID 0x7f2db12e3740) from PID 18446744072156287002 ***]
非法指令

@weifang74
Copy link

我这里发现同样的错误,换用paddleocr 2.6后报出如下错误:
[2024/05/08 11:14:55] ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=False, use_xpu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, shape_info_filename=None, precision='fp32', gpu_mem=500, image_dir=None, det_algorithm='DB', det_model_dir='/home/lxh/.paddleocr/whl/det/ch/ch_PP-OCRv3_det_infer', det_limit_side_len=960, det_limit_type='max', 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_sast_polygon=False, det_pse_thresh=0, det_pse_box_thresh=0.85, det_pse_min_area=16, det_pse_box_type='quad', det_pse_scale=1, scales=[8, 16, 32], alpha=1.0, beta=1.0, fourier_degree=5, det_fce_box_type='poly', rec_algorithm='SVTR_LCNet', rec_model_dir='/home/lxh/.paddleocr/whl/rec/ch/ch_PP-OCRv3_rec_infer', rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/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='/home/lxh/.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, 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, save_pdf=False, lang='ch', det=True, rec=True, type='ocr', ocr_version='PP-OCRv3', structure_version='PP-Structurev2')
Traceback (most recent call last):
File "/home/lxh/dev/paddle-ocr/ocr.py", line 7, in
result = ocr.ocr(img_path, cls=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/paddleocr.py", line 511, in ocr
dt_boxes, rec_res, _ = self.call(img, cls)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/tools/infer/predict_system.py", line 71, in call
dt_boxes, elapse = self.text_detector(img)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/tools/infer/predict_det.py", line 260, in call
post_result = self.postprocess_op(preds, shape_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/ppocr/postprocess/db_postprocess.py", line 240, in call
boxes, scores = self.boxes_from_bitmap(pred[batch_index], mask,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/ppocr/postprocess/db_postprocess.py", line 131, in boxes_from_bitmap
score = self.box_score_fast(pred, points.reshape(-1, 2))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/ppocr/postprocess/db_postprocess.py", line 188, in box_score_fast
xmin = np.clip(np.floor(box[:, 0].min()).astype(np.int), 0, w - 1)
^^^^^^
File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/numpy/init.py", line 324, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'int'.
np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?

@Sunting78
Copy link
Collaborator

可能是缺少cpu avx指令集,从源码编译下dlib试一下

@Sunting78
Copy link
Collaborator

我这里发现同样的错误,换用paddleocr 2.6后报出如下错误: [2024/05/08 11:14:55] ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=False, use_xpu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, shape_info_filename=None, precision='fp32', gpu_mem=500, image_dir=None, det_algorithm='DB', det_model_dir='/home/lxh/.paddleocr/whl/det/ch/ch_PP-OCRv3_det_infer', det_limit_side_len=960, det_limit_type='max', 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_sast_polygon=False, det_pse_thresh=0, det_pse_box_thresh=0.85, det_pse_min_area=16, det_pse_box_type='quad', det_pse_scale=1, scales=[8, 16, 32], alpha=1.0, beta=1.0, fourier_degree=5, det_fce_box_type='poly', rec_algorithm='SVTR_LCNet', rec_model_dir='/home/lxh/.paddleocr/whl/rec/ch/ch_PP-OCRv3_rec_infer', rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/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='/home/lxh/.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, 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, save_pdf=False, lang='ch', det=True, rec=True, type='ocr', ocr_version='PP-OCRv3', structure_version='PP-Structurev2') Traceback (most recent call last): File "/home/lxh/dev/paddle-ocr/ocr.py", line 7, in result = ocr.ocr(img_path, cls=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/paddleocr.py", line 511, in ocr dt_boxes, rec_res, _ = self.call(img, cls) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/tools/infer/predict_system.py", line 71, in call dt_boxes, elapse = self.text_detector(img) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/tools/infer/predict_det.py", line 260, in call post_result = self.postprocess_op(preds, shape_list) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/ppocr/postprocess/db_postprocess.py", line 240, in call boxes, scores = self.boxes_from_bitmap(pred[batch_index], mask, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/ppocr/postprocess/db_postprocess.py", line 131, in boxes_from_bitmap score = self.box_score_fast(pred, points.reshape(-1, 2)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/paddleocr/ppocr/postprocess/db_postprocess.py", line 188, in box_score_fast xmin = np.clip(np.floor(box[:, 0].min()).astype(np.int), 0, w - 1) ^^^^^^ File "/home/lxh/anaconda3/envs/paddle/lib/python3.12/site-packages/numpy/init.py", line 324, in getattr raise AttributeError(former_attrs[attr]) AttributeError: module 'numpy' has no attribute 'int'. np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?

这个问题是numpy版本问题,NumPy 1.20后将不使用np.int

@jzhang533
Copy link
Collaborator

related: #11597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants