resnet34_fpn_srn 报错
Created by: FieldRen
将rec_r50fpn_vd_none_srn.yml中的layers改成34
报错: Traceback (most recent call last): File "tools/train.py", line 123, in main() File "tools/train.py", line 50, in main config, train_program, startup_program, mode='train') File "/ssd2/exec/renzh/repos/PaddleOCR/tools/program.py", line 170, in build dataloader, outputs = model(mode=mode) File "/ssd2/exec/renzh/repos/PaddleOCR/ppocr/modeling/architectures/rec_model.py", line 193, in call conv_feas = self.backbone(inputs) File "/ssd2/exec/renzh/repos/PaddleOCR/ppocr/modeling/backbones/rec_resnet_fpn.py", line 105, in call name=conv_name) TypeError: basic_block() got an unexpected keyword argument 'if_first'
应该是rec_resnet_fpn.py +105行变量名写错了,将if_first改成is_first,又报错:
Error Message Summary:
InvalidArgumentError: The 3-th dimension of input[0] and input[1] is expected to be equal.But received input[0]'s shape = [-1, 256, 4, 640], input[1]'s shape = [-1, 256, 4, 320]. [Hint: Expected inputs_dims[0][j] == inputs_dims[i][j], but received inputs_dims[0][j]:640 != inputs_dims[i][j]:320.] at (/paddle/paddle/fluid/operators/concat_op.h:63) [operator < concat > error]
我的配置:
Global: algorithm: SRN use_gpu: true epoch_num: 72 log_smooth_window: 20 print_batch_step: 10 save_model_dir: output/rec_offline_r34_srn save_epoch_step: 1 eval_batch_step: 50000 train_batch_size_per_card: 24 test_batch_size_per_card: 24 image_shape: [1, 32, 640] max_text_length: 100 character_type: ch use_space_char: true character_dict_path: ./ppocr/utils/offline_dict.txt loss_type: srn num_heads: 8 average_window: 0.15 max_average_window: 15625 min_average_window: 10000 reader_yml: ./configs/rec/rec_offline_reader.yml pretrain_weights: checkpoints: save_inference_dir: infer_img:
Architecture: function: ppocr.modeling.architectures.rec_model,RecModel
Backbone: function: ppocr.modeling.backbones.rec_resnet_fpn,ResNet layers: 34
Head: function: ppocr.modeling.heads.rec_srn_all_head,SRNPredict encoder_type: rnn num_encoder_TUs: 2 num_decoder_TUs: 4 hidden_dims: 512 SeqRNN: hidden_size: 256
Loss: function: ppocr.modeling.losses.rec_srn_loss,SRNLoss
Optimizer: function: ppocr.optimizer,AdamDecay base_lr: 0.0001 beta1: 0.9 beta2: 0.999