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
#14506
Replies: 1 comment
-
The error Root CauseThe issue lies in the - image
- shape
- polys
- ignore_tags This configuration does not include the keys SolutionTo fix this, you need to modify the Eval:
dataset:
name: SimpleDataSet
data_dir: ./train_data/icdar2015/
label_file_list:
- ./train_data/icdar2015/test_icdar2015_label.txt
transforms:
- DecodeImage:
img_mode: BGR
channel_first: false
- DetLabelEncode: null
- DetResizeForTest: null
- NormalizeImage:
scale: 1./255.
mean:
- 0.485
- 0.456
- 0.406
std:
- 0.229
- 0.224
- 0.225
order: hwc
- ToCHWImage: null
- KeepKeys:
keep_keys:
- image
- shape
- threshold_map
- threshold_mask
- shrink_map
- shrink_mask
loader:
shuffle: false
drop_last: false
batch_size_per_card: 1
num_workers: 2 Explanation of Changes
ValidationAfter making the above changes, rerun your fine-tuning process: python tools/train.py -c configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.v2.yml This should resolve the unpacking issue during evaluation. Additional Notes
This fix should address the issue and allow fine-tuning to proceed successfully. Response generated by feifei-bot | chatgpt-4o-latest |
Beta Was this translation helpful? Give feedback.
-
🔎 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)
Beta Was this translation helpful? Give feedback.
All reactions