The first dimension of Input(Emission) and Input(Label) should be the same
Created by: lujinchao
- 标题:textone序列标注任务出现dimension不一致的问题
- 版本信息 (1)cuda9.0,cudnn7.3.0 (2)paddle 1.8.1
- 错误日志
Python Call Stacks (More useful to users): 1 export CUDA_VISIBLE_DEVICES=0
File "/home/work/lujinchao/query_brand/python_paddle_gpu/python/lib/python2.7/site-packages/paddle/fluid/framework.py", line 2610, in append_op attrs=kwargs.get("attrs", None)) File "/home/work/lujinchao/query_brand/python_paddle_gpu/python/lib/python2.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op return self.main_program.current_block().append_op(*args, **kwargs) File "/home/work/lujinchao/query_brand/python_paddle_gpu/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py", line 2185, in linear_chain_crf "LogLikelihood": log_likelihood File "../../textone/models/ernie_crf_sequence_label.py", line 133, in forward learning_rate=crf_lr)) File "../../textone/training/custom_trainer.py", line 33, in init BaseTrainer.init(self, params, data_set_reader, model_class) File "run_with_json.py", line 74, in build_trainer trainer = trainer_class(params=params_dict, data_set_reader=dataset_reader, model_class=model) File "run_with_json.py", line 91, in run_trainer trainer = build_trainer(trainer_params_dict, dataset_reader, model, num_train_examples) File "run_with_json.py", line 107, in run_trainer(_params)
Error Message Summary:
InvalidArgumentError: The first dimension of Input(Emission) and Input(Label) should be the same. But received Input(Emission): rank 2, shape [352, 7]; received Input(Label): rank 2, shape [353, 1]. [Hint: Expected emission_dims[0] == label_dims[0], but received emission_dims[0]:352 != label_dims[0]:353.] at (/paddle/paddle/fluid/operators/linear_chain_crf_op.cc:255) [operator < linear_chain_crf > error]