Несоответствие размера пакета в easyocrPython

Программы на Python
Ответить
Anonymous
 Несоответствие размера пакета в easyocr

Сообщение Anonymous »

RuntimeError: Error(s) in loading state_dict for DataParallel:
size mismatch for module.Prediction.weight: copying a param with shape torch.Size([143, 512]) from checkpoint, the shape in current model is torch.Size([127, 512]).
size mismatch for module.Prediction.bias: copying a param with shape torch.Size([143]) from checkpoint, the shape in current model is torch.Size([127]).

C:\Users\Santhuru\OneDrive\Desktop\text> py ecocr.py
Traceback (most recent call last):
File "C:\Users\Santhuru\OneDrive\Desktop\text\ecocr.py", line 3, in
reader = easyocr.Reader(['en', 'ta'])
File "C:\Users\Santhuru\OneDrive\Desktop\text\env1\lib\site-packages\easyocr\easyocr.py", line 231, in __init__
self.recognizer, self.converter = get_recognizer(recog_network, network_params,\
File "C:\Users\Santhuru\OneDrive\Desktop\text\env1\lib\site-packages\easyocr\recognition.py", line 182, in get_recognizer
model.load_state_dict(torch.load(model_path, map_location=device, weights_only=True))
File "C:\Users\Santhuru\OneDrive\Desktop\text\env1\lib\site-packages\torch\nn\modules\module.py", line 2584, in load_state_dict
raise RuntimeError(
RuntimeError: Error(s) in loading state_dict for DataParallel:
size mismatch for module.Prediction.weight: copying a param with shape torch.Size([143, 512]) from checkpoint, the shape in current model is torch.Size([127, 512]).
size mismatch for module.Prediction.bias: copying a param with shape torch.Size([143]) from checkpoint, the shape in current model is torch.Size([127]).


Подробнее здесь: https://stackoverflow.com/questions/792 ... in-easyocr
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»