PaddlePaddle / Paddle-Lite

PaddlePaddle High Performance Deep Learning Inference Engine for Mobile and Edge (飞桨高性能深度学习端侧推理引擎)
https://www.paddlepaddle.org.cn/lite
Apache License 2.0
6.9k stars 1.6k forks source link

如果ARM设备不接萤幕的情况下,则会出错 #8250

Closed chiehpower closed 2 years ago

chiehpower commented 2 years ago

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

版本、环境信息:

1)PaddlePaddle版本:release/2.2 2)ARM设备: NVIDIA Jetson AGX Xavier 3)系统环境:JetPack 4.5, Python版本 3.8

安装方式信息:

  1. 于docker内做编译 docker image: nvcr.io/nvidia/l4t-ml:r32.5.1-py3
  2. Python 3.8
  3. 操作流程参照此篇文章 https://www.codeleading.com/article/34695546218/
    git clone https://github.com/NVIDIA/nccl.git
    cd nccl
    make -j6
    sudo make install
git clone https://github.com/PaddlePaddle/Paddle.git
cd Paddle
git checkout release/2.0

cd build

cmake .. \
  -DWITH_CONTRIB=OFF \
  -DWITH_MKL=OFF  \
  -DWITH_MKLDNN=OFF \
  -DWITH_AVX=OFF \
  -DWITH_GPU=ON \
  -DWITH_TESTING=OFF \
  -DCMAKE_BUILD_TYPE=Release \
  -DON_INFER=ON \
  -DWITH_PYTHON=ON  \
  -DPY_VERSION=3.8  \
  -DWITH_XBYAK=OFF  \
  -DWITH_NV_JETSON=ON

make -j6
cd /paddle/build/python/dist
pip3 install -U (whl file)

python3.8 -m pip install scikit-image==0.19.1
python3.8 -m pip install shellcheck-py==0.8.0.1
python3.8 -m pip install "paddleocr>=2.0.1"

完整报错/Complete Error Message:

Script:

import os
import cv2
from paddleocr import PPStructure,draw_structure_result,save_structure_res

table_engine = PPStructure(show_log=True)

save_folder = './'
img_path = './testimage.png'
img = cv2.imread(img_path)
result = table_engine(img)
save_structure_res(result, save_folder,os.path.basename(img_path).split('.')[0])

for line in result:
    line.pop('img')
    print(line)

from PIL import Image

font_path = './simfang.ttf'
image = Image.open(img_path).convert('RGB')
im_show = draw_structure_result(image, result,font_path=font_path)
im_show = Image.fromarray(im_show)
im_show.save('result.jpg')

RUN it:

root@81112af1841e:~# python3 test.py 
download https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar to /root/.paddleocr/2.4/ocr/det/ch/ch_PP-OCRv2_det_infer/ch_PP-OCRv2_det_infer.tar
100%|█████████████████████████████████████████████████████████████████████████████████| 3.19M/3.19M [00:13<00:00, 243kiB/s]
download https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar to /root/.paddleocr/2.4/ocr/rec/ch/ch_PP-OCRv2_rec_infer/ch_PP-OCRv2_rec_infer.tar
100%|█████████████████████████████████████████████████████████████████████████████████| 8.88M/8.88M [00:20<00:00, 432kiB/s]
download https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar to /root/.paddleocr/2.4/ocr/table/en_ppocr_mobile_v2.0_table_structure_infer/en_ppocr_mobile_v2.0_table_structure_infer.tar
100%|████████████████████████████████████████████████████████████████████████████████| 19.7M/19.7M [00:10<00:00, 1.80MiB/s]
Namespace(benchmark=False, cls_batch_num=6, cls_image_shape='3, 48, 192', cls_model_dir=None, cls_thresh=0.9, cpu_threads=10, crop_res_save_dir='./output', det=True, det_algorithm='DB', 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/2.4/ocr/det/ch/ch_PP-OCRv2_det_infer', det_pse_box_thresh=0.85, det_pse_box_type='box', det_pse_min_area=16, det_pse_scale=1, det_pse_thresh=0, det_sast_nms_thresh=0.2, det_sast_polygon=False, 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, gpu_mem=500, help='==SUPPRESS==', image_dir=None, ir_optim=True, label_list=['0', '180'], label_map_path='./vqa/labels/labels_ser.txt', lang='ch', layout_path_model='lp://PubLayNet/ppyolov2_r50vd_dcn_365e_publaynet/config', max_batch_size=10, max_seq_length=512, max_text_length=25, min_subgraph_size=15, mode='structure', model_name_or_path=None, ocr_version='PP-OCRv2', output='./output', precision='fp32', process_id=0, rec=True, rec_algorithm='CRNN', rec_batch_num=6, rec_char_dict_path='/usr/local/lib/python3.8/dist-packages/paddleocr/ppocr/utils/ppocr_keys_v1.txt', rec_image_shape='3, 32, 320', rec_model_dir='/root/.paddleocr/2.4/ocr/rec/ch/ch_PP-OCRv2_rec_infer', save_crop_res=False, save_log_path='./log_output/', show_log=True, structure_version='STRUCTURE', table_char_dict_path='/usr/local/lib/python3.8/dist-packages/paddleocr/ppocr/utils/dict/table_structure_dict.txt', table_char_type='en', table_max_len=488, table_model_dir='/root/.paddleocr/2.4/ocr/table/en_ppocr_mobile_v2.0_table_structure_infer', total_process_num=1, type='ocr', use_angle_cls=False, use_dilation=False, use_gpu=True, use_mp=False, use_onnx=False, use_pdserving=False, use_space_char=True, use_tensorrt=False, vis_font_path='./doc/fonts/simfang.ttf', warmup=False)

--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
No stack trace in paddle, may be caused by external reasons.

----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
  [TimeInfo: *** Aborted at 1641958964 (unix time) try "date -d @1641958964" if you are using GNU date ***]
  [SignalInfo: *** SIGSEGV (@0x7f9a081090) received by PID 28768 (TID 0x7f9a089430) from PID 18446744071998804112 ***]

Segmentation fault (core dumped)

如果一开始设备有接上萤幕之后开机,则不会发生问题。 但是如果拔掉screen之后reboot,则就会发生问题。

paddle-bot-old[bot] commented 2 years ago

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网文档常见问题历史Issue来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQ and Github Issue to get the answer.Have a nice day!

zhaoyang-star commented 2 years ago

您的报错是在使用Paddle在NVIDIA Jetson AGX Xavier上报错,目前Paddle支持 Jetson 产品,但 Lite不支持 Jetson 产品。因此建议您将在Paddle repo中提交这个issue。