[PaddlePaddle/PaddleOCR]PGNET: 在训练时我将数据集安装要求改为14个点,出现两个错误,第一个我不确定是不是数据集格式的问题?第二个因为显存不够,需要修改batch_size吗?但是batch_size=14正是要求的14个标注点吗?

2024-05-20 627 views
8

-PS:自制数据集链接:文档:公开数据集 链接:http://note.youdao.com/noteshare?id=754b970aa21174543f97cddec88c2a34

  • 系统环境/System Environment:UBUNTU 20.04
  • 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:PGNET
  • 运行指令/Command Code:python3 tools/train.py -c configs/e2e/e2e_r50_vd_pg.yml -o Global.pretrained_model=./pretrain_models/train_step1/best_accuracy Global。 load_static_weights=False
  • 完整报错/Complete Error Message:
  • `(paddle_ocr_det) jeck@jeck-LEGION-REN7000K-26IOB:~/Public/PaddleOCR$ python3 tools/train.py -c configs/e2e/e2e_r50_vd_pg.yml -o Global.pretrained_model=./pretrain_models/train_step1/best_accuracy Global.load_static_weights=False [2022/02/18 17:24:51] root INFO: Architecture : [2022/02/18 17:24:51] root INFO: Backbone : [2022/02/18 17:24:51] root INFO: layers : 50 [2022/02/18 17:24:51] root INFO: name : ResNet [2022/02/18 17:24:51] root INFO: Head : [2022/02/18 17:24:51] root INFO: name : PGHead [2022/02/18 17:24:51] root INFO: Neck : [2022/02/18 17:24:51] root INFO: name : PGFPN [2022/02/18 17:24:51] root INFO: Transform : None [2022/02/18 17:24:51] root INFO: algorithm : PGNet [2022/02/18 17:24:51] root INFO: model_type : e2e [2022/02/18 17:24:51] root INFO: Eval : [2022/02/18 17:24:51] root INFO: dataset : [2022/02/18 17:24:51] root INFO: data_dir : ./train_data/total_text/test [2022/02/18 17:24:51] root INFO: label_file_list : ['./train_data/total_text/test/test.txt'] [2022/02/18 17:24:51] root INFO: name : PGDataSet [2022/02/18 17:24:51] root INFO: transforms : [2022/02/18 17:24:51] root INFO: DecodeImage : [2022/02/18 17:24:51] root INFO: channel_first : False [2022/02/18 17:24:51] root INFO: img_mode : BGR [2022/02/18 17:24:51] root INFO: E2ELabelEncodeTest : None [2022/02/18 17:24:51] root INFO: E2EResizeForTest : [2022/02/18 17:24:51] root INFO: max_side_len : 768 [2022/02/18 17:24:51] root INFO: NormalizeImage : [2022/02/18 17:24:51] root INFO: mean : [0.485, 0.456, 0.406] [2022/02/18 17:24:51] root INFO: order : hwc [2022/02/18 17:24:51] root INFO: scale : 1./255. [2022/02/18 17:24:51] root INFO: std : [0.229, 0.224, 0.225] [2022/02/18 17:24:51] root INFO: ToCHWImage : None [2022/02/18 17:24:51] root INFO: KeepKeys : [2022/02/18 17:24:51] root INFO: keep_keys : ['image', 'shape', 'polys', 'texts', 'ignore_tags', 'img_id'] [2022/02/18 17:24:51] root INFO: loader : [2022/02/18 17:24:51] root INFO: batch_size_per_card : 1 [2022/02/18 17:24:51] root INFO: drop_last : False [2022/02/18 17:24:51] root INFO: num_workers : 2 [2022/02/18 17:24:51] root INFO: shuffle : False [2022/02/18 17:24:51] root INFO: Global : [2022/02/18 17:24:51] root INFO: cal_metric_during_train : False [2022/02/18 17:24:51] root INFO: character_dict_path : ppocr/utils/ic15_dict.txt [2022/02/18 17:24:51] root INFO: character_type : EN [2022/02/18 17:24:51] root INFO: checkpoints : None [2022/02/18 17:24:51] root INFO: debug : False [2022/02/18 17:24:51] root INFO: distributed : False [2022/02/18 17:24:51] root INFO: epoch_num : 1500 [2022/02/18 17:24:51] root INFO: eval_batch_step : [0, 1000] [2022/02/18 17:24:51] root INFO: infer_img : None [2022/02/18 17:24:51] root INFO: load_static_weights : False [2022/02/18 17:24:51] root INFO: log_smooth_window : 20 [2022/02/18 17:24:51] root INFO: max_text_length : 50 [2022/02/18 17:24:51] root INFO: max_text_nums : 30 [2022/02/18 17:24:51] root INFO: pretrained_model : ./pretrain_models/train_step1/best_accuracy [2022/02/18 17:24:51] root INFO: print_batch_step : 10 [2022/02/18 17:24:51] root INFO: save_epoch_step : 10 [2022/02/18 17:24:51] root INFO: save_inference_dir : None [2022/02/18 17:24:51] root INFO: save_model_dir : ./output/pgnet_r50_vd_totaltext_0216/ [2022/02/18 17:24:51] root INFO: save_res_path : ./output/pgnet_r50_vd_totaltext_0216/predicts_pgnet.txt [2022/02/18 17:24:51] root INFO: tcl_len : 64 [2022/02/18 17:24:51] root INFO: use_gpu : True [2022/02/18 17:24:51] root INFO: use_visualdl : False [2022/02/18 17:24:51] root INFO: valid_set : totaltext [2022/02/18 17:24:51] root INFO: Loss : [2022/02/18 17:24:51] root INFO: max_text_length : 50 [2022/02/18 17:24:51] root INFO: max_text_nums : 30 [2022/02/18 17:24:51] root INFO: name : PGLoss [2022/02/18 17:24:51] root INFO: pad_num : 36 [2022/02/18 17:24:51] root INFO: tcl_bs : 64 [2022/02/18 17:24:51] root INFO: Metric : [2022/02/18 17:24:51] root INFO: character_dict_path : ppocr/utils/ic15_dict.txt [2022/02/18 17:24:51] root INFO: gt_mat_dir : ./train_data/total_text/gt [2022/02/18 17:24:51] root INFO: main_indicator : f_score_e2e [2022/02/18 17:24:51] root INFO: mode : A [2022/02/18 17:24:51] root INFO: name : E2EMetric [2022/02/18 17:24:51] root INFO: Optimizer : [2022/02/18 17:24:51] root INFO: beta1 : 0.9 [2022/02/18 17:24:51] root INFO: beta2 : 0.999 [2022/02/18 17:24:51] root INFO: lr : [2022/02/18 17:24:51] root INFO: learning_rate : 0.001 [2022/02/18 17:24:51] root INFO: name : Adam [2022/02/18 17:24:51] root INFO: regularizer : [2022/02/18 17:24:51] root INFO: factor : 0 [2022/02/18 17:24:51] root INFO: name : L2 [2022/02/18 17:24:51] root INFO: PostProcess : [2022/02/18 17:24:51] root INFO: mode : fast [2022/02/18 17:24:51] root INFO: name : PGPostProcess [2022/02/18 17:24:51] root INFO: score_thresh : 0.5 [2022/02/18 17:24:51] root INFO: Train : [2022/02/18 17:24:51] root INFO: dataset : [2022/02/18 17:24:51] root INFO: data_dir : ./train_data/total_text/train [2022/02/18 17:24:51] root INFO: label_file_list : ['./train_data/total_text/train/train.txt'] [2022/02/18 17:24:51] root INFO: name : PGDataSet [2022/02/18 17:24:51] root INFO: ratio_list : [1.0] [2022/02/18 17:24:51] root INFO: transforms : [2022/02/18 17:24:51] root INFO: DecodeImage : [2022/02/18 17:24:51] root INFO: channel_first : False [2022/02/18 17:24:51] root INFO: img_mode : BGR [2022/02/18 17:24:51] root INFO: E2ELabelEncodeTrain : None [2022/02/18 17:24:51] root INFO: PGProcessTrain : [2022/02/18 17:24:51] root INFO: batch_size : 14 [2022/02/18 17:24:51] root INFO: max_text_size : 512 [2022/02/18 17:24:51] root INFO: min_crop_size : 24 [2022/02/18 17:24:51] root INFO: min_text_size : 4 [2022/02/18 17:24:51] root INFO: KeepKeys : [2022/02/18 17:24:51] root INFO: keep_keys : ['images', 'tcl_maps', 'tcl_label_maps', 'border_maps', 'direction_maps', 'training_masks', 'label_list', 'pos_list', 'pos_mask'] [2022/02/18 17:24:51] root INFO: loader : [2022/02/18 17:24:51] root INFO: batch_size_per_card : 14 [2022/02/18 17:24:51] root INFO: drop_last : True [2022/02/18 17:24:51] root INFO: num_workers : 16 [2022/02/18 17:24:51] root INFO: shuffle : True [2022/02/18 17:24:51] root INFO: train with paddle 2.2.1 and device CUDAPlace(0) [2022/02/18 17:24:51] root INFO: Initialize indexs of datasets:['./train_data/total_text/train/train.txt'] [2022/02/18 17:24:51] root INFO: Initialize indexs of datasets:['./train_data/total_text/test/test.txt'] W0218 17:24:51.900465 4857 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 11.4, Runtime API Version: 11.2 W0218 17:24:51.902981 4857 device_context.cc:465] device: 0, cuDNN Version: 8.1. [2022/02/18 17:24:54] root INFO: loaded pretrained_model successful from ./pretrain_models/train_step1/best_accuracy.pdparams [2022/02/18 17:24:54] root INFO: train dataloader has 16 iters [2022/02/18 17:24:54] root INFO: valid dataloader has 91 iters [2022/02/18 17:24:54] root INFO: During the training process, after the 0th iteration, an evaluation is run every 1000 iterations [2022/02/18 17:24:54] root INFO: Initialize indexs of datasets:['./train_data/total_text/train/train.txt'] [2022/02/18 17:24:54] root ERROR: When parsing line 181, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 107, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 200, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 102, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 193, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 74, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 108, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 209, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 12, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 102, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:54] root ERROR: When parsing line 43, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 229, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 222, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 222, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 185, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 171, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 74, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 12, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 102, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 192, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (4,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 229, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 157, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 193, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 115, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 30, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 185, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 111, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 181, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 43, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 73, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 74, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 222, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 130, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 200, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 229, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 209, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 73, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 95, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 92, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 73, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 43, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 87, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 156, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 209, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 185, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 30, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 102, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:55] root ERROR: When parsing line 137, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 95, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 193, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 30, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 73, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 161, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 30, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 102, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 137, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 185, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 106, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 193, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 171, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 130, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 92, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 192, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (4,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 171, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 129, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (4,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 157, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 156, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 87, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 161, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 145, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 108, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 106, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 129, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (4,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 156, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 137, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 222, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 229, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 156, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 222, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:56] root ERROR: When parsing line 157, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:57] root ERROR: When parsing line 12, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:57] root ERROR: When parsing line 222, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:57] root ERROR: When parsing line 185, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:57] root ERROR: When parsing line 229, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:57] root ERROR: When parsing line 43, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:57] root ERROR: When parsing line 185, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. [2022/02/18 17:24:57] root ERROR: When parsing line 161, error happened with msg: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. Traceback (most recent call last): File "tools/train.py", line 131, in main(config, device, logger, vdl_writer) File "tools/train.py", line 106, in main program.train(config, train_dataloader, valid_dataloader, device, model, File "/home/jeck/Public/PaddleOCR/tools/program.py", line 221, in train preds = model(images) File "/home/jeck/miniconda/envs/paddle_ocr_det/lib/python3.8/site-packages/paddle/fluid/dygraph/layers.py", line 914, in call outputs = self.forward(*inputs, kwargs) File "/home/jeck/Public/PaddleOCR/ppocr/modeling/architectures/base_model.py", line 78, in forward x = self.neck(x) File "/home/jeck/miniconda/envs/paddle_ocr_det/lib/python3.8/site-packages/paddle/fluid/dygraph/layers.py", line 914, in call outputs = self.forward(*inputs, *kwargs) File "/home/jeck/Public/PaddleOCR/ppocr/modeling/necks/pg_fpn.py", line 310, in forward g[4] = self.conv_g4(g[4]) File "/home/jeck/miniconda/envs/paddle_ocr_det/lib/python3.8/site-packages/paddle/fluid/dygraph/layers.py", line 914, in call outputs = self.forward(inputs, kwargs) File "/home/jeck/Public/PaddleOCR/ppocr/modeling/necks/pg_fpn.py", line 63, in forward y = self._conv(inputs) File "/home/jeck/miniconda/envs/paddle_ocr_det/lib/python3.8/site-packages/paddle/fluid/dygraph/layers.py", line 914, in call outputs = self.forward(*inputs, *kwargs) File "/home/jeck/miniconda/envs/paddle_ocr_det/lib/python3.8/site-packages/paddle/nn/layer/conv.py", line 665, in forward out = F.conv._conv_nd( File "/home/jeck/miniconda/envs/paddle_ocr_det/lib/python3.8/site-packages/paddle/nn/functional/conv.py", line 123, in _conv_nd pre_bias = getattr(_C_ops, op_type)(x, weight, attrs) SystemError: (Fatal) Operator conv2d raises an paddle::memory::allocation::BadAlloc exception. The exception content is :ResourceExhaustedError:

Out of memory error on GPU 0. Cannot allocate 112.563965MB memory on GPU 0, 11.665466GB memory has been allocated and available memory is only 99.937500MB.

Please check whether there is any other process using GPU 0.

  1. If yes, please stop them, or start PaddlePaddle on another GPU.
  2. If no, please decrease the batch size of your model.

    (at /paddle/paddle/fluid/memory/allocation/cuda_allocator.cc:79) . (at /paddle/paddle/fluid/imperative/tracer.cc:221) `

回答

7

显存爆了,batchsize和14点没关系,可以设置成别的数

0

显存爆了,batchsize 和 14 点没关系,可以设置成其他数

嗯,谢谢

6

请问第一个问题您怎么解决的啊

5

batch_size 的大小不数据集中标记点的数量,应该是一个迭代数据的大小,根据显卡配置适当降低;关于数据集问题肯能需要更多数据保证模型的质量,我开始用了一千个数据,模型质量很差。

5

请问PGNet可以修改成支持任意标注点数训练吗 看了下代码中好像如果不是14点标记的数据会直接把输入设置为None然后去找其他数据直到输出不是None

3

要求修改成任意点的None点训练数据要求下代码中吗好像不是14点标记的数据会直接输入设置为一个然后PG网支持的其他数据输出可以不是None

当然没问题,开始也没限制标记数量,不过好像提供的模型,是14点标记的,如果你用4点标记数据在这个预训练模型的基础上再训练的话结果应该不会太理想。如果识别的弯曲文字角度不太大的话不建议使用PGNET,PGNET要达到适合你自己数据集效果比较困难。

7

感谢回复,我就算不用提供的与训练模型直接去训练模型也还是会遇到这个报错,就是像这样“root ERROR: When parsing line 1081, error happened with msg: setting an array element with a sequence.”,我使用的标注数据的标注点数量都不是固定的,比如弯取文本部分可能是十几个标注点,水平文本是四个标注点,请问如果要让程序训练不报这个error需要修改哪个位置呢?我暂时还没有找到,谢谢您~

1

很多情况下找不问题出在哪里,可能是环境问题,建议重新生成一个env,另外检测cuda,使用最新paddleocr

1

请问您最后是如何解决的

5

阅读了一下代码,这个error是因为在读入一张训练图片时,如果里面有多个不同标注点出来的文本行就会出现的,例如一张图片中两个被标注出来的文本行,一个是18点标注,一个是14点标注,就会导致这个error出现,因为代码里是把一张图片里的所有标注点列表一起转成一个np.array,标注点数不统一的时候就会导致转array失败,(1,18)和(1,14)显然不能合并成一个二维的array嘛,解决这个问题要么自己去调整训练读入标注数据的方式,要么就满足一张图片中所有文本的标注点数目都一样的限制,最好是所有图片的标注点数目都一样,效果最好

8

您是怎么让标注点都为14的呢,敬请不吝赐教

7

这个我也没有解决,只有自己手动调整标注数据,没有别的方法。无论用不用预训练模型都会有这个问题,因为这是模型训练过程中读取训练集导致的,不是因为加载的预训练模型导致的,我是换了另外的方法,我的标注数据不适合用在这个模型上

0

經過反反復復摸索,確定: 1,batch_size跟點位數無關; 2,圖像數據拉的框的標註點數默認可以是4/8/14之類的,但是沒有地方看得到這個參數,應該是程序自動識別到。所有的訓練集train、評估eval的圖像數據拉的框的標註點數必須保持的點數一致(要麼全部是4、全部是8、全部是14),如果有一個不是,都會報錯

3

是这样的,所有的数据标注的点数必须一致,不然无法Batch化