ZhuiyiTechnology / simbert

a bert for retrieval and generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

运行报错怎么回事?

LGY-111 opened this issue · comments

运行时候出现了报错:ValueError: initial_value must have a shape specified: Tensor("total_loss_1/eye/set_diag:0", shape=(?, ?), dtype=float32),想请教下怎么修改?
image
debug定位到报错地方为compute_loss_of_similarity()函数

改为:

similarities = similarities - tf.eye(K.shape(y_pred)[0]) * 1e12  # 排除对角线