使用TX2运行非combined模型找不到kernels
Created by: Ligcox
我训练好了yolo v3模型,并将其保存,在TX2上部署出现错误,程序源码如下:
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
sys.path.append('/home/dji/Downloads/paddle-lite/build_cuda/inference_lite_lib/python/lib')
import cv2
import numpy as np
from paddlelite.lite import *
from PIL import Image
# 模型参数
model_parameters = {
'freeze_dir':"/home/dji/Desktop/model",
'label_dict': {'red1': 0, 'red2': 1, 'red3': 2, 'red4': 3, 'red5': 4, 'red6': 5, 'red7': 6, 'red8': 7, 'red9': 8, 'blue1': 9, 'blue2': 10, 'blue3': 11, 'blue4': 12, 'blue5': 13, 'blue6': 14, 'blue7': 15, 'blue8': 16, 'blue9': 17},
'num_dict': {0: 'red1', 1: 'red2', 2: 'red3', 3: 'red4', 4: 'red5', 5: 'red6', 6: 'red7', 7: 'red8', 8: 'red9', 9: 'blue1', 10: 'blue2', 11: 'blue3', 12: 'blue4', 13: 'blue5', 14: 'blue6', 15: 'blue7', 16: 'blue8', 17: 'blue9'},
'class_dim': 18,
}
def load_model_detect():
config = CxxConfig()
config.set_model_dir(model_parameters['freeze_dir'])
places = Place(TargetType.CUDA)
print(config.model_dir())
config.set_valid_places([places])
predictor = create_paddle_predictor(config)
return predictor
运行后输出: dji@manifold2:~/Desktop$ python test.py /home/dji/Desktop/model WARNING: Logging before InitGoogleLogging() is written to STDERR I0826 05:25:39.033563 24939 device_info.h:176] Found 1 device(s) I0826 05:25:40.292371 24939 device_info.h:185] dev size = 1 I0826 05:25:40.292469 24939 cxx_api.cc:251] Load model from file. I0826 05:25:40.889806 24939 optimizer.h:202] == Running pass: lite_quant_dequant_fuse_pass I0826 05:25:40.940904 24939 optimizer.h:219] == Finished running: lite_quant_dequant_fuse_pass I0826 05:25:40.941004 24939 optimizer.h:202] == Running pass: weight_quantization_preprocess_pass I0826 05:25:40.942214 24939 optimizer.h:219] == Finished running: weight_quantization_preprocess_pass I0826 05:25:40.942253 24939 optimizer.h:202] == Running pass: lite_conv_elementwise_fuse_pass I0826 05:25:40.965626 24939 pattern_matcher.cc:108] detected 3 subgraph I0826 05:25:40.968525 24939 optimizer.h:219] == Finished running: lite_conv_elementwise_fuse_pass I0826 05:25:40.968580 24939 optimizer.h:202] == Running pass: lite_conv_bn_fuse_pass I0826 05:25:41.176401 24939 pattern_matcher.cc:108] detected 72 subgraph I0826 05:25:41.229904 24939 optimizer.h:219] == Finished running: lite_conv_bn_fuse_pass I0826 05:25:41.229986 24939 optimizer.h:202] == Running pass: lite_conv_elementwise_fuse_pass I0826 05:25:41.258882 24939 optimizer.h:219] == Finished running: lite_conv_elementwise_fuse_pass I0826 05:25:41.258934 24939 optimizer.h:202] == Running pass: lite_conv_activation_fuse_pass I0826 05:25:41.322938 24939 pattern_matcher.cc:108] detected 72 subgraph I0826 05:25:41.349356 24939 optimizer.h:219] == Finished running: lite_conv_activation_fuse_pass I0826 05:25:41.349439 24939 optimizer.h:202] == Running pass: lite_var_conv_2d_activation_fuse_pass I0826 05:25:41.349750 24939 optimizer.h:219] == Finished running: lite_var_conv_2d_activation_fuse_pass I0826 05:25:41.349776 24939 optimizer.h:202] == Running pass: lite_fc_fuse_pass I0826 05:25:41.349802 24939 optimizer.h:215] - Skip lite_fc_fuse_pass because the target or kernel does not match. I0826 05:25:41.349826 24939 optimizer.h:202] == Running pass: lite_shuffle_channel_fuse_pass I0826 05:25:41.350744 24939 optimizer.h:219] == Finished running: lite_shuffle_channel_fuse_pass I0826 05:25:41.350777 24939 optimizer.h:202] == Running pass: lite_transpose_softmax_transpose_fuse_pass I0826 05:25:41.351470 24939 optimizer.h:219] == Finished running: lite_transpose_softmax_transpose_fuse_pass I0826 05:25:41.351501 24939 optimizer.h:202] == Running pass: lite_interpolate_fuse_pass I0826 05:25:41.352684 24939 optimizer.h:219] == Finished running: lite_interpolate_fuse_pass I0826 05:25:41.352715 24939 optimizer.h:202] == Running pass: identity_scale_eliminate_pass I0826 05:25:41.353313 24939 optimizer.h:219] == Finished running: identity_scale_eliminate_pass I0826 05:25:41.353345 24939 optimizer.h:202] == Running pass: elementwise_mul_constant_eliminate_pass I0826 05:25:41.353821 24939 optimizer.h:219] == Finished running: elementwise_mul_constant_eliminate_pass I0826 05:25:41.353852 24939 optimizer.h:202] == Running pass: lite_sequence_pool_concat_fuse_pass I0826 05:25:41.354923 24939 optimizer.h:219] == Finished running: lite_sequence_pool_concat_fuse_pass I0826 05:25:41.354952 24939 optimizer.h:202] == Running pass: lite_elementwise_add_activation_fuse_pass I0826 05:25:41.356588 24939 optimizer.h:219] == Finished running: lite_elementwise_add_activation_fuse_pass I0826 05:25:41.356617 24939 optimizer.h:202] == Running pass: __xpu__resnet_fuse_pass I0826 05:25:41.356634 24939 optimizer.h:215] - Skip __xpu__resnet_fuse_pass because the target or kernel does not match. I0826 05:25:41.356659 24939 optimizer.h:202] == Running pass: __xpu__multi_encoder_fuse_pass I0826 05:25:41.356680 24939 optimizer.h:215] - Skip __xpu__multi_encoder_fuse_pass because the target or kernel does not match. I0826 05:25:41.356700 24939 optimizer.h:202] == Running pass: __xpu__embedding_with_eltwise_add_fuse_pass I0826 05:25:41.356722 24939 optimizer.h:215] - Skip __xpu__embedding_with_eltwise_add_fuse_pass because the target or kernel does not match. I0826 05:25:41.356741 24939 optimizer.h:202] == Running pass: __xpu__fc_fuse_pass I0826 05:25:41.356760 24939 optimizer.h:215] - Skip __xpu__fc_fuse_pass because the target or kernel does not match. I0826 05:25:41.356777 24939 optimizer.h:202] == Running pass: identity_dropout_eliminate_pass I0826 05:25:41.356791 24939 optimizer.h:215] - Skip identity_dropout_eliminate_pass because the target or kernel does not match. I0826 05:25:41.356803 24939 optimizer.h:202] == Running pass: quantized_op_attributes_inference_pass I0826 05:25:41.356818 24939 optimizer.h:215] - Skip quantized_op_attributes_inference_pass because the target or kernel does not match. I0826 05:25:41.356832 24939 optimizer.h:202] == Running pass: npu_subgraph_pass I0826 05:25:41.356845 24939 optimizer.h:215] - Skip npu_subgraph_pass because the target or kernel does not match. I0826 05:25:41.356860 24939 optimizer.h:202] == Running pass: xpu_subgraph_pass I0826 05:25:41.356874 24939 optimizer.h:215] - Skip xpu_subgraph_pass because the target or kernel does not match. I0826 05:25:41.356886 24939 optimizer.h:202] == Running pass: bm_subgraph_pass I0826 05:25:41.356899 24939 optimizer.h:215] - Skip bm_subgraph_pass because the target or kernel does not match. I0826 05:25:41.356911 24939 optimizer.h:202] == Running pass: apu_subgraph_pass I0826 05:25:41.356930 24939 optimizer.h:215] - Skip apu_subgraph_pass because the target or kernel does not match. I0826 05:25:41.356952 24939 optimizer.h:202] == Running pass: rknpu_subgraph_pass I0826 05:25:41.356971 24939 optimizer.h:215] - Skip rknpu_subgraph_pass because the target or kernel does not match. I0826 05:25:41.356988 24939 optimizer.h:202] == Running pass: static_kernel_pick_pass F0826 05:25:41.358215 24939 static_kernel_pick_pass.cc:65] Check failed: !instruct.kernels().empty() No kernels found for slice *** Check failure stack trace: *** Aborted (core dumped)