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

Jetson nano 执行GPU预测报错:Error Message Summary:FatalError:' Segmentation fault' is detected by the operating system. #1332

Open
Irvingao opened this issue Mar 20, 2021 · 3 comments
Assignees
Labels
installation Issues of Installation

Comments

@Irvingao
Copy link

Irvingao commented Mar 20, 2021

image

  • 版本、环境信息
    1)PaddleHub和PaddlePaddle版本:PaddleHub:1.8.0,PaddlePaddle-gpu:2.0.0
    2)系统环境:Jetson nano Ubuntu18.04,python3.6.9
  • 复现信息:

from jetcam.csi_camera import CSICamera
import paddlehub as hub
import cv2
import time

def draw_bbox_image(img, data_list):
    for boxes in data_list:
        print(boxes)
        left = int(boxes["left"] * img.shape[1])
        right = int(boxes["right"] * img.shape[1])
        top = int(boxes["top"] * img.shape[0])
        bottom = int(boxes["bottom"] * img.shape[0])
        confidence = str(boxes["confidence"])
        cv2.rectangle(img, (left, top), (right, bottom), (0,255,0), 2)
        cv2.putText(img, confidence, (left, top-2), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0,255,0), 2)

if __name__ == "__main__":
    camera = CSICamera(capture_device=0, width=224, height=224)

    object_detector = hub.Module(name="ssd_mobilenet_v1_pascal")
    
    while True:
        frame = camera.read()

        tim1 = time.time()
        result = object_detector.object_detection(images=[frame], use_gpu=True)
        try:
            data_list = result[0]["data"]
            draw_bbox_image(frame, data_list)
            print("data_list:", data_list)
        except IndexError:
            pass
        cv2.imshow("result", frame)
        tim2 = time.time()
        tim = tim2 - tim1
        print("tim", tim)
        print("result", result)
        if cv2.waitKey(1) & 0xFF == ord('q'):
                break
@Irvingao
Copy link
Author

Irvingao commented Mar 20, 2021

采用单张图片

CPU预测正常:

image

GPU预测报错:

image

@haoyuying
Copy link
Contributor

请您参考#1301
查看自己的cuda和cudnn及paddlepaddle-gpu三者之间的版本是否匹配,一般出现segmentation fault一般是由于cudnn和cuda版本及paddlepaddle-gpu版本不匹配导致的

@haoyuying haoyuying self-assigned this Mar 22, 2021
@haoyuying haoyuying added the installation Issues of Installation label Mar 22, 2021
@jiafuzeng
Copy link

image

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

No branches or pull requests

3 participants