ernie-gen使用时,用cnn语料做生成式摘要的的模型启动`run_seq2seq.sh`报错
Created by: cedar33
ernie-gen使用时,用cnn生成式摘要的的模型启动run_seq2seq.sh
报错
InvalidArgumentError: Broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [8, 20, 768] and the shape of Y = [0, 20, 768]. Received [8] in X is not equal to [0] in Y.
报错位置代码
def _gen_input(self, emb_ids, input_mask):
emb_out = None
for emb_name, emb_id in emb_ids.items():
emb = fluid.layers.embedding(
input=emb_id,
size=[self._emb_vocab_size[emb_name], self._emb_size],
dtype=self._emb_dtype,
param_attr=fluid.ParamAttr(
name=emb_name, initializer=self._param_initializer))
logging.info("************************_gen_input_emb:"+emb_name+"******************************")
logging.info(emb.shape)
if emb_out:
logging.info(emb_out.shape)
emb_out = emb_out + emb if emb_out else emb
文件
ernie-gen/model/ernie.py