Segmentation fault (core dumped) when running YOLOv3 model
Created by: hieunm1821
OS: ARM-linux, aarch64 Python: 3.7 PaddleLite: 2.6.1
I have tried some different yolo model from PaddleDetection, Link model 1, Link model 2 and also tried to opt model from yml config and pre-trained weights by myself.
I got the Segmentation fault.
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1064 Setup] ARM multiprocessors name:
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1065 Setup] ARM multiprocessors number: 8
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 0, max freq: 0, min freq: 0, cluster ID: 0, CPU ARCH: A72
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 1, max freq: 0, min freq: 0, cluster ID: 0, CPU ARCH: A72
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 2, max freq: 0, min freq: 0, cluster ID: 0, CPU ARCH: A72
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 3, max freq: 0, min freq: 0, cluster ID: 0, CPU ARCH: A72
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 4, max freq: 0, min freq: 0, cluster ID: 0, CPU ARCH: A72
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 5, max freq: 0, min freq: 0, cluster ID: 0, CPU ARCH: A72
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 6, max freq: 0, min freq: 0, cluster ID: 0, CPU ARCH: A72
[I 6/29 7:18:56.702 ...ieu/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 7, max freq: 0, min freq: 0, cluster ID: 0, CPU ARCH: A72
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1073 Setup] L1 DataCache size is:
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 48 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 48 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 48 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 48 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 48 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 48 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 48 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 48 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1077 Setup] L2 Cache size is:
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 2048 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 2048 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 2048 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 2048 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 2048 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 2048 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 2048 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 2048 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1081 Setup] L3 Cache size is:
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB
[I 6/29 7:18:56.703 ...ieu/Paddle-Lite/lite/core/device_info.cc:1085 Setup] Total memory: 15885904KB
Segmentation fault (core dumped)
My code for running model:
from paddlelite.lite import *
import numpy as np
import cv2
def read_img(im_path, resize_h, resize_w):
im = cv2.imread(im_path).astype('int64')
im = cv2.cvtColor(im, cv2.COLOR_BGR2RGB)
h, w, _ = im.shape
im_scale_x = resize_h / float(w)
im_scale_y = resize_w / float(h)
out_img = cv2.resize(im, None, None, fx=im_scale_x, fy=im_scale_y, interpolation=cv2.INTER_CUBIC)
mean = np.array([0.485, 0.456, 0.406]).reshape((1, 1, -1))
std = np.array([0.229, 0.224, 0.225]).reshape((1, 1, -1))
out_img = (out_img / 255.0 - mean) / std
out_img = out_img.transpose((2, 0, 1))
return out_img
a = CxxConfig()
a.set_model_file('./yolov3_infer/__model__')
a.set_param_file('./yolov3_infer/__params__')
predictor = create_paddle_predictor(a)
input_tensor = predictor.get_input(0);
height, width = 608, 608
input_tensor.resize([1, 3, height, width])
data = read_img('./test_images/kite.jpg', height, width).flatten()
input_tensor.set_float_data(data)
in2 = predictor.get_input(1);
in2.resize([1, 2])
in2.set_int32_data([height, width])
predictor.run()
output_tensor = predictor.get_output(0);
print (output_tensor.shape())