Kashgari icon indicating copy to clipboard operation
Kashgari copied to clipboard

自定义模型 训练 保存 再倒入使用报错

Open xrzlizheng opened this issue 3 years ago • 5 comments

File ".\getvec.py", line 86, in pro_model =Double_BiLSTM_Model.load_model('double_model') File "d:\anaconda3\lib\site-packages\kashgari\tasks\abs_task_model.py", line 101, in load_model model = load_data_object(model_config) File "d:\anaconda3\lib\site-packages\kashgari\utils\serialize.py", line 25, in load_data_object obj: Any = pydoc.locate(module_name)(**data['config'], **kwargs) # type: ignore TypeError: 'NoneType' object is not callable

xrzlizheng avatar Apr 02 '21 03:04 xrzlizheng

2.0.2 版本应该修复了该问题,可以测试一下~

BrikerMan avatar Jul 04 '21 10:07 BrikerMan

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.

stale[bot] avatar Apr 16 '22 03:04 stale[bot]

仍然报错

AnitaSherry avatar Jun 20 '22 09:06 AnitaSherry

我也遇到了类似的问题,我的解决方法是将自定义的模型放到kashgari.tasks.classification 中,重新导入模型解决了此问题。不知有没有别的load_model()方法.

pineapple-427 avatar Dec 02 '22 06:12 pineapple-427

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.

stale[bot] avatar Jun 18 '23 07:06 stale[bot]