baudm / parseq

Scene Text Recognition with Permuted Autoregressive Sequence Models (ECCV 2022)
https://huggingface.co/spaces/baudm/PARSeq-OCR
Apache License 2.0
555 stars 125 forks source link

KeyError: 'pytorch-lightning_version' #137

Open laster-lee opened 4 months ago

laster-lee commented 4 months ago

Traceback (most recent call last): File "e:\kc_infer\kc_test.py", line 7, in parseq = load_from_checkpoint("./parseq_tiny.pt").eval() File "e:\kc_infer\strhub\models\utils.py", line 92, in load_from_checkpoint model = ModelClass.load_from_checkpoint(checkpoint_path, *kwargs) File "D:\anaconda3\envs\kc_infer\lib\site-packages\pytorch_lightning\utilities\model_helpers.py", line 125, in wrapper return self.method(cls, args, **kwargs) File "D:\anaconda3\envs\kc_infer\lib\site-packages\pytorch_lightning\core\module.py", line 1581, in load_from_checkpoint loaded = _load_from_checkpoint( File "D:\anaconda3\envs\kc_infer\lib\site-packages\pytorch_lightning\core\saving.py", line 66, in _load_from_checkpoint checkpoint = _pl_migrate_checkpoint( File "D:\anaconda3\envs\kc_infer\lib\site-packages\pytorch_lightning\utilities\migration\utils.py", line 143, in _pl_migrate_checkpoint old_version = _get_version(checkpoint) File "D:\anaconda3\envs\kc_infer\lib\site-packages\pytorch_lightning\utilities\migration\utils.py", line 164, in _get_version return checkpoint["pytorch-lightning_version"] KeyError: 'pytorch-lightning_version'

EtherealTan commented 3 months ago

i have the same question have you solved it?

laster-lee commented 3 months ago

i have the same question have you solved it?我有同样的问题,你解决了吗?

没解决,后面我自己训练模型了,用自己的数据集

GIN-Margarita commented 1 month ago

you need execuate with --checkpoint pretrained=

example: python read.py --checkpoint pretrained=vitstr --images ./demo_images/art-01107.jpg ./demo_images/coco-1166773.jpg meanwhile ,you need update read.py args with --checkpoints , such as : image

GIN-Margarita commented 1 month ago

additionally , utils.py has urls of model you could update url with the local dir. image