Open Thomnt2306 opened 3 years ago
Hi @Thomnt2306 , The problem is about loading model pre-trained model. As far as I know, if you trained your model using multi-gpu setting then your weights' dictionary will be saved with module.xxxxx
prefix. I think you did not use multi-gpu settings while training. If so, you should change demo.py
's following line
FROM
https://github.com/clovaai/deep-text-recognition-benchmark/blob/68a80fe97943a111ff1efaf52a63ad8f0f1c0e5d/demo.py#L29
TO
model = model.to(device)
Hi @Thomnt2306 , The problem is about loading model pre-trained model. As far as I know, if you trained your model using multi-gpu setting then your weights' dictionary will be saved with
module.xxxxx
prefix. I think you did not use multi-gpu settings while training. If so, you should changedemo.py
's following line FROM https://github.com/clovaai/deep-text-recognition-benchmark/blob/68a80fe97943a111ff1efaf52a63ad8f0f1c0e5d/demo.py#L29TO
model = model.to(device)
thank you very much! However, I have tried and failed. I would like to add that when I run demo.py with the built-in model everything is fine but when I run with my own model everything is fine. encountered the same error as above. Please answer.Again,Thank you very much!
If 'Yes' for for three questions, then the model should work, I guess. I also trained this model from scratch recently here.
exp_name: None-VGG-BiLSTM-CTC-Seed1111 train_data: training/train valid_data: training/validation manualSeed: 1111 workers: 4 batch_size: 192 num_iter: 300000 valInterval: 2000 saved_model: FT: False adam: False lr: 1 beta1: 0.9 rho: 0.95 eps: 1e-08 grad_clip: 5 baiduCTC: False select_data: ['train'] batch_ratio: ['1'] total_data_usage_ratio: 1.0 batch_max_length: 100 imgH: 32 imgW: 400 rgb: False character: !"%&()*,-./0123456789JzZ:;?@ABCDEFGHIKLMNOPQRSTUVWXY_abcdefghijklmnopqrstuvwxyÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯưẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ sensitive: False PAD: False data_filtering_off: False Transformation: None FeatureExtraction: VGG SequenceModeling: BiLSTM Prediction: CTC num_fiducial: 20 input_channel: 1 output_channel: 512 hidden_size: 256 num_gpu: 1 num_class: 214 This is my opt.txt. My computer has 1 GPU device and I don't have any changes during model saving. Thanks very much!
Could you print model parameters?
for param_tensor in net.state_dict():
print(param_tensor)
Hi, first of all, thank you very much for your input. After running with my own data set, I train and test without error, but after running de mo.py file, I get the error like the picture above. Looking forward to the answer. thanks!