Closed 2205825969 closed 2 years ago
改配置文件就可以了
大佬,我直接改配置文件如下
Global:
debug: true
use_gpu: false
epoch_num: 1200
log_smooth_window: 20
print_batch_step: 1000
save_model_dir: F:\pythonProject\PaddleOCR-release-2.4/output/rec/mv3_none_bilstm_ctc_punctuation/
save_epoch_step: 100
eval_batch_step:
2000 cal_metric_during_train: true pretrained_model: checkpoints: null save_inference_dir: null use_visualdl: false infer_img: doc/imgs_words_en/word_10.png character_dict_path: F:\pythonProject\PaddleOCR-release-2.4/ppocr/utils/yw_dict.txt max_text_length: 25 infer_mode: false use_space_char: false save_res_path: F:\pythonProject\PaddleOCR-release-2.4/output/rec/predicts_mv3_none_bilstm_ctc.txt Optimizer: name: Adam beta1: 0.9 beta2: 0.999 lr: learning_rate: 0.0005 regularizer: name: L2 factor: 0 Architecture: model_type: rec algorithm: CRNN Transform: null Backbone: name: MobileNetV3 scale: 0.5 model_name: large Neck: name: SequenceEncoder encoder_type: rnn hidden_size: 96 Head: name: CTCHead fc_decay: 0 Loss: name: CTCLoss PostProcess: name: CTCLabelDecode Metric: name: RecMetric main_indicator: acc Train: dataset: name: SimpleDataSet data_dir: F:\pythonProject\PaddleOCR-release-2.4/traindata/test_rec/train label_file_list:
但是报错
Traceback (most recent call last):
File "F:/pythonProject/PaddleOCR-release-2.4/tools/train.py", line 149, in
高度变为64后,需要增大最后一层卷积的stride,在这里https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.4/ppocr/modeling/backbones/rec_mv1_enhance.py#L203
把stride=1
改为stride=(2, 1)
大佬我修改了,但是还是出现这个错误
conv6 = DepthwiseSeparable(
num_channels=int(1024 * scale),
num_filters1=1024,
num_filters2=1024,
num_groups=1024,
stride=(2, 1),
dw_size=5,
padding=2,
use_se=True,
scale=scale)
self.block_list.append(conv6)
......
......
......
[2022/03/31 20:19:48] root INFO: train from scratch
[2022/03/31 20:19:48] root INFO: train dataloader has 62 iters
[2022/03/31 20:19:48] root INFO: valid dataloader has 7 iters
[2022/03/31 20:19:48] root INFO: During the training process, after the 0th iteration, an evaluation is run every 2000 iterations
[2022/03/31 20:19:48] root INFO: Initialize indexs of datasets:['F:\pythonProject\PaddleOCR-release-2.4/traindata/test_rec/train_label.txt']
Traceback (most recent call last):
File "F:/pythonProject/PaddleOCR-release-2.4/tools/train.py", line 149, in
Process finished with exit code 1
抱歉,刚才看错了,你用的backbone是MobileNetV3,改一下这里的stride https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.4/ppocr/modeling/backbones/rec_mobilenet_v3.py#L124
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem