ernie model prediction problem
Created by: guru4elephant
为使您的问题得到快速解决,在建立Issue前,请您先通过如下方式搜索是否有相似问题:【搜索issue关键字】【使用labels筛选】【官方文档】
如果您没有查询到相似问题,为快速解决您的提问,建立issue时请提供如下细节信息:
- 标题:简洁、精准描述您的问题,例如“最新预测库的API文档在哪儿 ”
- 版本、环境信息: 1)PaddlePaddle版本:请提供您的PaddlePaddle版本号 1.7.2 2)GPU:预测若用GPU,请提供GPU型号、CUDA和CUDNN版本号,CUDA 9.2,CUDNN 7.3 4)系统环境:CentOS 6u3, py2
Error Message Summary:
NotFoundError: DataType should be indicated by input Variable at scale. [Hint: Expected data_type != dafault_data_type, but received data_type:-1 == dafault_data_type:-1.] at (/home/users/dongdaxiang/Paddle/paddle/fluid/framework/operator.cc:1316) [operator < scale > error]
- 复现信息:如为报错,请给出复现环境、复现步骤
import numpy as np
import time
import sys
from paddle.fluid.core import PaddleTensor
from paddle.fluid.core import AnalysisConfig
from paddle.fluid.core import create_paddle_predictor
fetch_list = ['embedding_0.tmp_0', 'embedding_1.tmp_0', 'embedding_2.tmp_0', 'layer_norm_6.tmp_2', 'layer_norm_12.tmp_2', 'layer_norm_18.tmp_2', 'layer_norm_2\
4.tmp_2', 'dropout_7.tmp_0', 'dropout_16.tmp_0', 'dropout_25.tmp_0', 'dropout_34.tmp_0']
src_ids = [1, 3770, 2366, 3, 193, 12043, 2, 65, 179, 106, 286, 609, 3117, 184, 21, 497, 193, 1914, 1058, 82, 12043, 2]
sent_ids = [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
src_ids.extend([0]*(300 - len(src_ids)))
sent_ids.extend([0]*(300 - len(sent_ids)))
src_ids = np.array(src_ids).reshape((len(src_ids), 1))
sent_ids = np.array(sent_ids).reshape((len(sent_ids), 1))
model_path = "ernie_model/"
config = AnalysisConfig(model_path)
config.enable_use_gpu(100, 0)
has_bug = True
config.switch_ir_optim(has_bug)
predictor = create_paddle_predictor(config)
inputs = [PaddleTensor(src_ids[np.newaxis, :]), PaddleTensor(sent_ids[np.newaxis, :])]
outputs = predictor.run(inputs)
print(outputs)
- 问题描述:基本定位在embedding_eltwise_layernorm_fuse_pass,在ernie模型上造成了以上报错,关闭掉所有pass可以跑通