BrikerMan / Kashgari

Kashgari is a production-level NLP Transfer learning framework built on top of tf.keras for text-labeling and text-classification, includes Word2Vec, BERT, and GPT2 Language Embedding.
http://kashgari.readthedocs.io/
Apache License 2.0
2.4k stars 441 forks source link

[Question] Errors of Bi_LSTM classification model when using TF 2.4.1 and kashgari 2.0.1 #459

Closed Harrypeas closed 2 years ago

Harrypeas commented 3 years ago

You must follow the issue template and provide as much information as possible. otherwise, this issue will be closed. 请按照 issue 模板要求填写信息。如果没有按照 issue 模板填写,将会忽略并关闭这个 issue

Check List

Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.

You can post pictures, but if specific text or code is required to reproduce the issue, please provide the text in a plain text format for easy copy/paste.

Environment

[Paste requirements.txt file here]

Question

I'm trying to create a Chinese text classification model (BiLSTM) by following the tutorial. I have two environments, one is tensorflow1.5 on my MacBook, and the other one is tensorflow2.4.1 and kashgari2.0.1 on my linux server. On my MacBook, the model works well and the accuracy achieves 99% in the first epoch. However, the model on the server performs bad, its loss is decreasing at the first (the minimum is about 0.5), then it starts to grow (the maximum is about 3.0), and finally it decreases slowly. Besides, there has some other errors in my model, for example, I set the sequence length to 512 but the message in the figure shows that it is None. I know that tutorial is more applicable for tensorflow1.X, so I would like to if there any problems in my code.

截屏2021-03-02 上午10 55 10 截屏2021-03-02 上午10 56 20
BrikerMan commented 3 years ago

Please retry it with the latest version.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.