自定义模型 训练 保存 再倒入使用报错
xrzlizheng opened this issue · 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
2.0.2 版本应该修复了该问题,可以测试一下~
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.
仍然报错
我也遇到了类似的问题,我的解决方法是将自定义的模型放到kashgari.tasks.classification 中,重新导入模型解决了此问题。不知有没有别的load_model()方法.
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.