privacy icon indicating copy to clipboard operation
privacy copied to clipboard

ValueError: None values not supported.

Open RANCE-sama opened this issue 2 years ago • 0 comments

RANCE-sama avatar Mar 24 '22 10:03 RANCE-sama

大概确定了应该是网络模型中映入了预训练的bert模型,但不知道该怎么改。 network structure: embedding = bert_model(input_id, attention_mask=input_mask, token_type_ids=input_atn)[0] x = tf.keras.layers.GlobalAveragePooling1D()(embedding)
x = tf.keras.layers.Dropout(0.15)(x) x = tf.keras.layers.Dense(3, activation='softmax')(x) model = tf.keras.models.Model(inputs=[input_id, input_mask, input_atn], outputs=x) Mostly because the bert embedding, but dont know how to fix it.

RANCE-sama avatar Mar 24 '22 14:03 RANCE-sama

最后把embedding层全设成untrainable能跑了 Finally I set the embedding layer all not trainable and it works

RANCE-sama avatar Mar 25 '22 03:03 RANCE-sama