Replies: 1 comment
-
Ensure that your dataset images and corresponding labels are correctly paired and formatted. Each image should have corresponding label information, and the labels should be consistent with the expected format for the TextDetDataset. |
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
-
Hi. I'm trying to train Paddle OCR using images, but an error is occurring. The error message is as follows.
Shape list content: [Tensor(shape=[8], dtype=int32, place=Place(gpu_pinned), stop_gradient=True,
[1860, 1953, 591 , 2748, 2204, 1974, 2858, 390 ]), Tensor(shape=[8], dtype=int32, place=Place(gpu_pinned), stop_gradient=True,
[3682, 3982, 646 , 3384, 2725, 3853, 4164, 766 ]), Tensor(shape=[8], dtype=float64, place=Place(gpu_pinned), stop_gradient=True,
[0.34408602, 0.32770097, 1.08291032, 0.23289665, 0.29038113, 0.32421479,
0.22393282, 1.64102564]), Tensor(shape=[8], dtype=float64, place=Place(gpu_pinned), stop_gradient=True,
[0.17381858, 0.16072325, 0.99071207, 0.18912530, 0.23486239, 0.16610433,
0.15369837, 0.83550914])]
Images shape: [[3, 640, 640], [3, 640, 640], [3, 640, 640], [3, 640, 640], [3, 640, 640], [3, 640, 640], [3, 640, 640], [3, 640, 640]]
Debug: Shape list in epoch 2, step 2328: [Tensor(shape=[8], dtype=int32, place=Place(gpu_pinned), stop_gradient=True,
[564 , 2288, 2634, 2248, 2628, 2246, 550 , 2208]), Tensor(shape=[8], dtype=int32, place=Place(gpu_pinned), stop_gradient=True,
[696 , 4374, 3176, 4474, 3433, 3253, 1037, 4394]), Tensor(shape=[8], dtype=float64, place=Place(gpu_pinned), stop_gradient=True,
[1.13475177, 0.27972028, 0.24297646, 0.28469751, 0.24353120, 0.28495102,
1.16363636, 0.28985507]), Tensor(shape=[8], dtype=float64, place=Place(gpu_pinned), stop_gradient=True,
[0.91954023, 0.14631916, 0.20151134, 0.14304873, 0.18642587, 0.19674147,
0.61716490, 0.14565316])]
Error: Mismatch in batch at index 2328
Images length: 8, Shape list length: 4
And, it's yml code.
Global:
use_gpu: true
epoch_num: 2 # 100
log_smooth_window: 20
print_batch_step: 10
save_model_dir: ./output/db_mv3/
save_epoch_step: 20
eval_batch_step: [0, 2000] # [0.2000]
cal_metric_during_train: False
#pretrained_model: ./pretrain_models/MobileNetV3_large_x0_5_pretrained
checkpoints:
save_inference_dir: ./inference/db_mv3/
use_visualdl: False
infer_img:
save_res_path: ./output/det_db/predicts_db.txt
Optimizer:
name: Adam
beta1: 0.9
beta2: 0.999
lr:
name: Cosine
learning_rate: 0.001
warmup_epoch: 2
regularizer:
name: 'L2'
factor: 0.0001
Architecture:
model_type: det
algorithm: DB
Transform:
Backbone:
name: MobileNetV3
scale: 0.5
model_name: large
disable_se: True
Neck:
name: DBFPN
out_channels: 256
Head:
name: DBHead
k: 50
Train:
dataset:
name: TextDetDataset
data_dir: C:/Users/USER/anaconda3/envs/content_combine/data_combine
label_file_list:
- C:/Users/USER/anaconda3/envs/content_combine/paddleocr_annotations.csv
transforms:
- DecodeImage:
img_mode: BGR
channel_first: True # NCHW
- Resize:
image_shape: [3, 640, 640]
- DetLabelEncode:
- IaaAugment:
augmenter_args:
- {type: Fliplr, args: {p: 0.5}}
- {type: Affine, args: {rotate: [-10, 10]}}
- KeepKeys:
keep_keys: ['image', 'shape', 'polys', 'texts', 'ignore_tags']
loader:
shuffle: True
drop_last: True
batch_size_per_card: 8
num_workers: 4
Eval:
dataset:
name: TextDetDataset
data_dir: C:/Users/USER/anaconda3/envs/content_combine/data_combine
label_file_list:
- C:/Users/USER/anaconda3/envs/content_combine/paddleocr_annotations.csv
transforms:
- DecodeImage:
img_mode: BGR
channel_first: True
- Resize:
image_shape: [3, 640, 640]
- DetLabelEncode:
- KeepKeys:
keep_keys: ['image', 'shape', 'polys', 'texts', 'ignore_tags']
loader:
shuffle: True
drop_last: True
batch_size_per_card: 8
num_workers: 4
PostProcess:
name: DBPostProcess
thresh: 0.3
box_thresh: 0.6
max_candidates: 1000
unclip_ratio: 1.5
Metric:
name: DetMetric
main_indicator: hmean
Loss:
name: DBLoss
balance_loss: True
main_loss_type: DiceLoss
alpha: 5.0
beta: 10.0
ohem_ratio: 3
paddleocr==2.7.0.3
paddlepaddle==2.5.0
Plz help me
Beta Was this translation helpful? Give feedback.
All reactions