You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seeing ValueError: not enough values to unpack (expected 4, got 3) in ppocr/losses/det_db_loss.py when fine-tuning detection model ch_PP-OCRv3 with ch_PP-OCRv3_det_student.yml#13995
Open
3 tasks done
nicolaskodak opened this issue
Oct 14, 2024
· 0 comments
I have searched the PaddleOCR Docs and found no similar bug report.
I have searched the PaddleOCR Issues and found no similar bug report.
I have searched the PaddleOCR Discussions and found no similar bug report.
🐛 Bug (问题描述)
To fine-tune detection model, I've created a config file (modified from ch_PP-OCRv3_det_student.yml and download ICDAR2015 following this readme.
a config file has been created: configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.v2.yml
data and annotations have been placed accordingly: train_data/icdar2015/train_icdar2015_label.txt, train_data/icdar2015/ch4_training_images, train_data/icdar2015/test_icdar2015_label.txt, train_data/icdar2015/ch4_test_images.
During fine-tuning, when it reaches the 40th step, an evaluation using data from valid_dataloader) was run; however, an exception was thrown and the process terminated as below:
Traceback (most recent call last):
File "tools/train.py", line 208, in <module>
main(config, device, logger, vdl_writer)
File "tools/train.py", line 180, in main
program.train(config, train_dataloader, valid_dataloader, device, model,
File "/home/kota/ocr/PaddleOCR/tools/program.py", line 387, in train
cur_metric = eval(
File "/home/kota/ocr/PaddleOCR/tools/program.py", line 548, in eval
eval_loss = loss_class( preds, batch)['loss']
File "/home/kota/py38ocr/lib/python3.8/site-packages/paddle/nn/layer/layers.py", line 1254, in __call__
return self.forward(*inputs, **kwargs)
File "/home/kota/ocr/PaddleOCR/ppocr/losses/det_db_loss.py", line 58, in forward
label_threshold_map, label_threshold_mask, label_shrink_map, label_shrink_mask = labels[
ValueError: not enough values to unpack (expected 4, got 3)
As far as I've investigated, the valid_dataloader doesn't yield labels as a tuple of 5 elements. It has 4 elements instead and the shapes of them don't seem to look like label_threshold_map, label_threshold_mask, label_shrink_map, label_shrink_mask.
Could anyone shed some light on this? Many thanks.
🔎 Search before asking
🐛 Bug (问题描述)
To fine-tune detection model, I've created a config file (modified from
ch_PP-OCRv3_det_student.yml
and download ICDAR2015 following this readme.configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.v2.yml
train_data/icdar2015/train_icdar2015_label.txt
,train_data/icdar2015/ch4_training_images
,train_data/icdar2015/test_icdar2015_label.txt
,train_data/icdar2015/ch4_test_images
.The content of the config file is shown below:
To execute fine-tuning, I've run
During fine-tuning, when it reaches the 40th step, an evaluation using data from valid_dataloader) was run; however, an exception was thrown and the process terminated as below:
As far as I've investigated, the valid_dataloader doesn't yield
labels
as a tuple of 5 elements. It has 4 elements instead and the shapes of them don't seem to look likelabel_threshold_map
,label_threshold_mask
,label_shrink_map
,label_shrink_mask
.Could anyone shed some light on this? Many thanks.
🏃♂️ Environment (运行环境)
OS
Device
paddle-related packages are shown below
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
The text was updated successfully, but these errors were encountered: