运行python接口,output.float_data()出现错误
Created by: CaoT94
config = MobileConfig()
config.set_model_from_file('models/model.nb')
predictor = create_paddle_predictor(config)
input_tensor = predictor.get_input(0)
input_tensor.resize([1, 6])
input_tensor.set_float_data([1.0302923443767364, -1.9898957727866762, 0.015035466153107671, -0.13710096975917996, 0.4984869715241052, 0.258893581574035])
predictor.run()
output = predictor.get_output(0)
print(output.shape())
print(output.float_data())
能够输出形状[1,10], 但是转换为float时出现错误Segmentation fault (core dumped)。paddle原来的模型可以正常运行,用opt转化了模型。