SVTRv2(Rec Sever) eval modes gives error #14908
amandhapola
started this conversation in
General
Replies: 1 comment
-
The error you are encountering during the evaluation ( img_height = properties[1] Possible Causes and Solutions:
Next Steps:
If the issue persists, please provide an example line from your dataset ( Response generated by 🤖 feifei-bot | chatgpt-4o-latest |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi ,
I have been trying to finetune the SVTRv2 model url on ICDAR 15 dataset . The training runs fine but while running the eval mode as specified in here I get the following issue .
System : `
Linux CentOS
python 3.10.14
Paddle Docker image : paddlepaddle/paddle:3.0.0rc1-gpu-cuda12.3-cudnn9.0-trt8.6
`
Training Command :
!python3 tools/train.py \ -c configs/rec/SVTRv2/rec_repsvtr_gtc.yml \ -o Global.pretrained_model=./pretrain_models/svtrv2_1/openatom_rec_svtrv2_ch_train/best_accuracy
Eval command :
!python3 tools/eval.py \ -c configs/rec/SVTRv2/rec_repsvtr_gtc.yml \ -o Global.pretrained_model=./output/rec_repsvtr_gtc/latest
Eval command output :
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script [2025/03/20 06:09:13] ppocr WARNING: Skipping import of the encryption module. [2025/03/20 06:09:13] ppocr INFO: Architecture : [2025/03/20 06:09:13] ppocr INFO: Backbone : [2025/03/20 06:09:13] ppocr INFO: name : RepSVTR [2025/03/20 06:09:13] ppocr INFO: Head : [2025/03/20 06:09:13] ppocr INFO: head_list : [2025/03/20 06:09:13] ppocr INFO: CTCHead : [2025/03/20 06:09:13] ppocr INFO: Head : [2025/03/20 06:09:13] ppocr INFO: fc_decay : 1e-05 [2025/03/20 06:09:13] ppocr INFO: Neck : [2025/03/20 06:09:13] ppocr INFO: depth : 2 [2025/03/20 06:09:13] ppocr INFO: dims : 256 [2025/03/20 06:09:13] ppocr INFO: hidden_dims : 256 [2025/03/20 06:09:13] ppocr INFO: kernel_size : [1, 3] [2025/03/20 06:09:13] ppocr INFO: name : svtr [2025/03/20 06:09:13] ppocr INFO: use_guide : True [2025/03/20 06:09:13] ppocr INFO: NRTRHead : [2025/03/20 06:09:13] ppocr INFO: max_text_length : 25 [2025/03/20 06:09:13] ppocr INFO: nrtr_dim : 384 [2025/03/20 06:09:13] ppocr INFO: num_decoder_layers : 2 [2025/03/20 06:09:13] ppocr INFO: name : MultiHead [2025/03/20 06:09:13] ppocr INFO: Transform : None [2025/03/20 06:09:13] ppocr INFO: algorithm : SVTR_HGNet [2025/03/20 06:09:13] ppocr INFO: model_type : rec [2025/03/20 06:09:13] ppocr INFO: Eval : [2025/03/20 06:09:13] ppocr INFO: dataset : [2025/03/20 06:09:13] ppocr INFO: data_dir : ./dataset/rec_dataset/ [2025/03/20 06:09:13] ppocr INFO: label_file_list : ./dataset/rec_dataset/rec_gt_test.txt [2025/03/20 06:09:13] ppocr INFO: name : MultiScaleDataSet [2025/03/20 06:09:13] ppocr INFO: transforms : [2025/03/20 06:09:13] ppocr INFO: DecodeImage : [2025/03/20 06:09:13] ppocr INFO: channel_first : False [2025/03/20 06:09:13] ppocr INFO: img_mode : BGR [2025/03/20 06:09:13] ppocr INFO: MultiLabelEncode : [2025/03/20 06:09:13] ppocr INFO: gtc_encode : NRTRLabelEncode [2025/03/20 06:09:13] ppocr INFO: RecResizeImg : [2025/03/20 06:09:13] ppocr INFO: image_shape : [3, 48, 320] [2025/03/20 06:09:13] ppocr INFO: KeepKeys : [2025/03/20 06:09:13] ppocr INFO: keep_keys : ['image', 'label_ctc', 'label_gtc', 'length', 'valid_ratio'] [2025/03/20 06:09:13] ppocr INFO: loader : [2025/03/20 06:09:13] ppocr INFO: batch_size_per_card : 8 [2025/03/20 06:09:13] ppocr INFO: drop_last : False [2025/03/20 06:09:13] ppocr INFO: num_workers : 0 [2025/03/20 06:09:13] ppocr INFO: shuffle : False [2025/03/20 06:09:13] ppocr INFO: Global : [2025/03/20 06:09:13] ppocr INFO: cal_metric_during_train : False [2025/03/20 06:09:13] ppocr INFO: character_dict_path : ppocr/utils/ppocr_keys_v1.txt [2025/03/20 06:09:13] ppocr INFO: checkpoints : None [2025/03/20 06:09:13] ppocr INFO: debug : False [2025/03/20 06:09:13] ppocr INFO: distributed : False [2025/03/20 06:09:13] ppocr INFO: epoch_num : 10 [2025/03/20 06:09:13] ppocr INFO: eval_batch_step : [0, 1000] [2025/03/20 06:09:13] ppocr INFO: infer_img : doc/imgs_words/ch/word_1.jpg [2025/03/20 06:09:13] ppocr INFO: infer_mode : False [2025/03/20 06:09:13] ppocr INFO: log_smooth_window : 20 [2025/03/20 06:09:13] ppocr INFO: max_text_length : 25 [2025/03/20 06:09:13] ppocr INFO: pretrained_model : ./output/rec_repsvtr_gtc/latest [2025/03/20 06:09:13] ppocr INFO: print_batch_step : 10 [2025/03/20 06:09:13] ppocr INFO: save_epoch_step : 10 [2025/03/20 06:09:13] ppocr INFO: save_inference_dir : None [2025/03/20 06:09:13] ppocr INFO: save_model_dir : ./output/rec_repsvtr_gtc [2025/03/20 06:09:13] ppocr INFO: save_res_path : ./output/rec/predicts_repsvtr.txt [2025/03/20 06:09:13] ppocr INFO: use_gpu : True [2025/03/20 06:09:13] ppocr INFO: use_space_char : True [2025/03/20 06:09:13] ppocr INFO: use_visualdl : False [2025/03/20 06:09:13] ppocr INFO: Loss : [2025/03/20 06:09:13] ppocr INFO: loss_config_list : [2025/03/20 06:09:13] ppocr INFO: CTCLoss : None [2025/03/20 06:09:13] ppocr INFO: NRTRLoss : None [2025/03/20 06:09:13] ppocr INFO: name : MultiLoss [2025/03/20 06:09:13] ppocr INFO: Metric : [2025/03/20 06:09:13] ppocr INFO: main_indicator : acc [2025/03/20 06:09:13] ppocr INFO: name : RecMetric [2025/03/20 06:09:13] ppocr INFO: Optimizer : [2025/03/20 06:09:13] ppocr INFO: beta1 : 0.9 [2025/03/20 06:09:13] ppocr INFO: beta2 : 0.999 [2025/03/20 06:09:13] ppocr INFO: epsilon : 1e-08 [2025/03/20 06:09:13] ppocr INFO: lr : [2025/03/20 06:09:13] ppocr INFO: learning_rate : 0.001 [2025/03/20 06:09:13] ppocr INFO: name : Cosine [2025/03/20 06:09:13] ppocr INFO: warmup_epoch : 5 [2025/03/20 06:09:13] ppocr INFO: name : AdamW [2025/03/20 06:09:13] ppocr INFO: no_weight_decay_name : norm [2025/03/20 06:09:13] ppocr INFO: one_dim_param_no_weight_decay : True [2025/03/20 06:09:13] ppocr INFO: weight_decay : 0.025 [2025/03/20 06:09:13] ppocr INFO: PostProcess : [2025/03/20 06:09:13] ppocr INFO: name : CTCLabelDecode [2025/03/20 06:09:13] ppocr INFO: Train : [2025/03/20 06:09:13] ppocr INFO: dataset : [2025/03/20 06:09:13] ppocr INFO: data_dir : ./dataset/rec_dataset/ [2025/03/20 06:09:13] ppocr INFO: ds_width : False [2025/03/20 06:09:13] ppocr INFO: ext_op_transform_idx : 1 [2025/03/20 06:09:13] ppocr INFO: label_file_list : ./dataset/rec_dataset/rec_gt_train.txt [2025/03/20 06:09:13] ppocr INFO: name : MultiScaleDataSet [2025/03/20 06:09:13] ppocr INFO: transforms : [2025/03/20 06:09:13] ppocr INFO: DecodeImage : [2025/03/20 06:09:13] ppocr INFO: channel_first : False [2025/03/20 06:09:13] ppocr INFO: img_mode : BGR [2025/03/20 06:09:13] ppocr INFO: RecAug : None [2025/03/20 06:09:13] ppocr INFO: MultiLabelEncode : [2025/03/20 06:09:13] ppocr INFO: gtc_encode : NRTRLabelEncode [2025/03/20 06:09:13] ppocr INFO: KeepKeys : [2025/03/20 06:09:13] ppocr INFO: keep_keys : ['image', 'label_ctc', 'label_gtc', 'length', 'valid_ratio'] [2025/03/20 06:09:13] ppocr INFO: loader : [2025/03/20 06:09:13] ppocr INFO: batch_size_per_card : 8 [2025/03/20 06:09:13] ppocr INFO: drop_last : True [2025/03/20 06:09:13] ppocr INFO: num_workers : 0 [2025/03/20 06:09:13] ppocr INFO: shuffle : True [2025/03/20 06:09:13] ppocr INFO: sampler : [2025/03/20 06:09:13] ppocr INFO: divided_factor : [8, 16] [2025/03/20 06:09:13] ppocr INFO: first_bs : 192 [2025/03/20 06:09:13] ppocr INFO: fix_bs : False [2025/03/20 06:09:13] ppocr INFO: is_training : True [2025/03/20 06:09:13] ppocr INFO: name : MultiScaleSampler [2025/03/20 06:09:13] ppocr INFO: scales : [[320, 32], [320, 48], [320, 64]] [2025/03/20 06:09:13] ppocr INFO: profiler_options : None [2025/03/20 06:09:13] ppocr INFO: train with paddle 3.0.0-rc1 and device Place(gpu:0) [2025/03/20 06:09:13] ppocr INFO: Initialize indexs of datasets:./dataset/rec_dataset/rec_gt_test.txt W0320 06:09:13.830448 7523 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.9, Driver API Version: 12.8, Runtime API Version: 12.3 W0320 06:09:13.831583 7523 gpu_resources.cc:164] device: 0, cuDNN Version: 9.1. [2025/03/20 06:09:14] ppocr INFO: load pretrain successful from ./output/rec_repsvtr_gtc/latest [2025/03/20 06:09:14] ppocr INFO: metric in ckpt *************** [2025/03/20 06:09:14] ppocr INFO: is_float16:False eval model:: 0%| | 0/260 [00:00<?, ?it/s]Exception in thread Thread-2 (_thread_loop): Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/paddle/io/dataloader/dataloader_iter.py", line 245, in _thread_loop batch = self._dataset_fetcher.fetch( File "/usr/local/lib/python3.10/dist-packages/paddle/io/dataloader/fetcher.py", line 77, in fetch data.append(self.dataset[idx]) File "/paddle/PaddleOCR/ppocr/data/simple_dataset.py", line 210, in __getitem__ img_height = properties[1] TypeError: 'int' object is not subscriptable
Beta Was this translation helpful? Give feedback.
All reactions