EasyOCR 使用使用深度文本识别基准训练的模型

at0kjp5o  于 2个月前  发布在  其他
关注(0)|答案(3)|浏览(43)

根据您提供的错误信息,问题出在model.py文件中的Model类的初始化方法。错误提示为:TypeError: Model.**init**() got an unexpected keyword argument 'num_class',意味着Model类的初始化方法中没有预期到名为num_class的关键字参数。

为了解决这个问题,您需要找到Model类的初始化方法(可能是__init__from_pretrained等),并检查是否有使用不正确的关键字参数。如果您能提供model.py文件的相关代码,我可以帮助您找到具体的问题并提供解决方案。

vyu0f0g1

vyu0f0g11#

在这里也存在同样的问题。

zbwhf8kr

zbwhf8kr2#

我也遇到该问题, model = model_pkg.Model(num_class=num_class, **network_params)

qltillow

qltillow3#

the "init(self, opt):" need opt object as a parameter whereas the "model = model_pkg.Model(num_class=num_class, **network_params)" passes network_params object as a parameter.

  1. I think, one need to redefine the init(self, opt) as shown in the custom_example.py file. i.e. def init(self, input_channel, output_channel, hidden_size, num_class):
  2. one need to update the config.yaml file with 'network_params' as well, just as mentioned in the custom_example.yaml

相关问题