PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
42.92k stars 7.71k forks source link

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

Closed Dong-star623 closed 4 months ago

Dong-star623 commented 4 months ago

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

PaddleOCR:2.7.2版本


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 commented 4 months ago

我这里发现同样的错误,换用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, recres, = 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 commented 4 months ago

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

Sunting78 commented 4 months ago

我这里发现同样的错误,换用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, recres, = 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 commented 4 months ago

related: #11597