-
-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
model.save:TypeError: Object of type module is not JSON serializable #461
Comments
Version being used: kashgari2.0.0 |
I've met the same problem while training a labeling model. |
The problem remains unsolved |
also encountered this problem. |
got this problem too |
I tried to find why this happened. I have located the problem, it’s in this file “lib/python3.6/site-packages/kashgari/tasks/abs_task_model.py” The structure of “module” might have wrong type, not JSON, so it cannot be serializied. Also noticed that Keras has the same issue. keras-team/keras#9342 my Setup: |
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. |
我把 |
from kashgari.corpus import ChineseDailyNerCorpus
from kashgari.embeddings import BertEmbedding
from kashgari.tasks.labeling import BiLSTM_CRF_Modelb
import kashgari
X_train, y_train = ChineseDailyNerCorpus.load_data('train')
x_test, y_test = ChineseDailyNerCorpus.load_data('test')
X_valid, y_valid = ChineseDailyNerCorpus.load_data('valid')
bert_embed = BertEmbedding('./bert/chinese_roberta_wwm_ext_L-12_H-768_A-12',
task=kashgari.tasks.labeling,
sequence_length=100)
model = BiLSTM_CRF_Model(bert_embed)
model.fit(X_train, y_train, X_valid, y_valid, epochs=1,batch_size=512)
The text was updated successfully, but these errors were encountered: