clovaai / deep-text-recognition-benchmark

Text recognition (optical character recognition) with deep learning methods, ICCV 2019
Apache License 2.0
3.76k stars 1.11k forks source link

Can't test a pretrained model #424

Closed Meriem-DAHMANI closed 5 months ago

Meriem-DAHMANI commented 5 months ago

When running this command :

 CUDA_VISIBLE_DEVICES=0 python3 demo.py --Transformation TPS --FeatureExtraction ResNet --SequenceModeling BiLSTM --Prediction Attn --image_folder demo_image/ --saved_model models/None-VGG-BiLSTM-CTC.pth

I am having this error :

 self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DataParallel:
    Missing key(s) in state_dict: "module.Transformation.LocalizationNetwork.conv.0.weight", 
Meriem-DAHMANI commented 5 months ago

Issue solved : i updated demo.py :

model.load_state_dict(torch.load(opt.saved_model, map_location=device), strict=False)