python api demo报Segmentation fault (core dumped)
Created by: vincentpengpeng
环境:arm64 RK3399开发板,ubuntu18 mobilenetv1_light_api.py文件(修改了input_tensor): from future import absolute_import from future import division from future import print_function
import argparse
from paddlelite.lite import *
parser = argparse.ArgumentParser() parser.add_argument( "--model_dir", default="", type=str, help="Non-combined Model dir path")
def RunModel(args):
config = MobileConfig()
config.set_model_from_file(args.model_dir)
predictor = create_paddle_predictor(config)
input_tensor = predictor.get_input(0)
input_tensor.resize([1, 3, 608, 608])
input_tensor.set_float_data([1.] * 3 * 608 * 608)
predictor.run()
output_tensor = predictor.get_output(0)
print(output_tensor.shape())
print(output_tensor.float_data()[:10])
if name == 'main': args = parser.parse_args() RunModel(args)
调用命令: python mobilenetv1_light_api.py --model_dir='/home/firefly/Paddle-Lite-Demo-master/PaddleLite-armlinux-demo/object_detection_demo/models/pedestrian_yolov3_darknet/pedestrian_yolov3_darknet_opt.nb'
结果: [I 7/24 16:32:42.922 ...fly/Paddle-Lite/lite/core/device_info.cc:1064 Setup] ARM multiprocessors name: [I 7/24 16:32:42.922 ...fly/Paddle-Lite/lite/core/device_info.cc:1065 Setup] ARM multiprocessors number: 6 [I 7/24 16:32:42.922 ...fly/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 0, max freq: 1416, min freq: 1416, cluster ID: 1, CPU ARCH: A53 [I 7/24 16:32:42.922 ...fly/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 1, max freq: 1416, min freq: 1416, cluster ID: 1, CPU ARCH: A53 [I 7/24 16:32:42.922 ...fly/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 2, max freq: 1416, min freq: 1416, cluster ID: 1, CPU ARCH: A53 [I 7/24 16:32:42.922 ...fly/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 3, max freq: 1416, min freq: 1416, cluster ID: 1, CPU ARCH: A53 [I 7/24 16:32:42.922 ...fly/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 4, max freq: 1800, min freq: 1800, cluster ID: 0, CPU ARCH: A72 [I 7/24 16:32:42.922 ...fly/Paddle-Lite/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 5, max freq: 1800, min freq: 1800, cluster ID: 0, CPU ARCH: A72 [I 7/24 16:32:42.922 ...fly/Paddle-Lite/lite/core/device_info.cc:1073 Setup] L1 DataCache size is: [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1075 Setup] 32 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1077 Setup] L2 Cache size is: [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1079 Setup] 512 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1081 Setup] L3 Cache size is: [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1083 Setup] 0 KB [I 7/24 16:32:42.923 ...fly/Paddle-Lite/lite/core/device_info.cc:1085 Setup] Total memory: 3937208KB [W 7/24 16:32:42.924 ...e-Lite/lite/model_parser/model_parser.cc:811 LoadModelNaiveFromFile] warning: the version of opt that transformed this model is not consistent with current Paddle-Lite version. version of opt:v2.6.1 version of current Paddle-Lite:00bd7f44 Segmentation fault (core dumped)