I have searched related issues but cannot get the expected help.
The bug has not been fixed in the latest version.
Describe the bug
I trained the fcenet_r50dcnv2_fpn_1500e_ctw1500 and fcenet_r50_fpn_1500e_icdar2015 on ICDAR2015 (my custom dataset). I use the DB net for training which is successful but trained with FCENET is failed.
My config log file when training model is attached here
20211123_174847.log.zip
2. You may add addition that may be helpful for locating the problem, such as
- How you installed PyTorch [e.g., pip, conda, source]
- I followed the MMOCR's tutorial (section **Install Dependencies**): https://github.com/open-mmlab/mmocr/blob/main/demo/MMOCR_Tutorial.ipynb
Command:
- Other environment variables that may be related (such as `$PATH`, `$LD_LIBRARY_PATH`, `$PYTHONPATH`, etc.)
**Error traceback**
If applicable, paste the error traceback here.
```none
Traceback (most recent call last):
File "tools/train.py", line 221, in <module>
main()
File "tools/train.py", line 217, in main
meta=meta)
File "/content/drive/My Drive/Colab_Notebook/text_scence_detection/mmocr/mmocr/apis/train.py", line 165, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/usr/local/lib/python3.7/dist-packages/mmcv/runner/epoch_based_runner.py", line 127, in run
epoch_runner(data_loaders[i], **kwargs)
File "/usr/local/lib/python3.7/dist-packages/mmcv/runner/epoch_based_runner.py", line 47, in train
for i, data_batch in enumerate(self.data_loader):
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1085, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1111, in _process_data
data.reraise()
File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 428, in reraise
raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.7/dist-packages/mmdet/datasets/custom.py", line 195, in __getitem__
data = self.prepare_train_img(idx)
File "/usr/local/lib/python3.7/dist-packages/mmdet/datasets/custom.py", line 218, in prepare_train_img
return self.pipeline(results)
File "/usr/local/lib/python3.7/dist-packages/mmdet/datasets/pipelines/compose.py", line 41, in __call__
data = t(data)
File "/content/drive/My Drive/Colab_Notebook/text_scence_detection/mmocr/mmocr/datasets/pipelines/textdet_targets/base_textdet_targets.py", line 167, in __call__
results = self.generate_targets(results)
File "/content/drive/My Drive/Colab_Notebook/text_scence_detection/mmocr/mmocr/datasets/pipelines/textdet_targets/fcenet_targets.py", line 350, in generate_targets
polygon_masks_ignore)
File "/content/drive/My Drive/Colab_Notebook/text_scence_detection/mmocr/mmocr/datasets/pipelines/textdet_targets/fcenet_targets.py", line 316, in generate_level_targets
level_img_size, lv_text_polys[ind])[None]
File "/content/drive/My Drive/Colab_Notebook/text_scence_detection/mmocr/mmocr/datasets/pipelines/textdet_targets/fcenet_targets.py", line 71, in generate_center_region_mask
top_line, bot_line, self.resample_step)
File "/content/drive/My Drive/Colab_Notebook/text_scence_detection/mmocr/mmocr/datasets/pipelines/textdet_targets/textsnake_targets.py", line 281, in resample_sidelines
resampled_line1 = self.resample_line(sideline1, resample_point_num)
File "/content/drive/My Drive/Colab_Notebook/text_scence_detection/mmocr/mmocr/datasets/pipelines/textdet_targets/textsnake_targets.py", line 231, in resample_line
while current_line_len >= length_cumsum[current_edge_ind + 1]:
IndexError: index 2 is out of bounds for axis 0 with size 2
Bug fix
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!
I train DBnet (text detection) on my custom dataset is successful. But I used fcenet_r50dcnv2_fpn_1500e_ctw1500 then generated this bug above.
Please help me fix that bug. Thank you.
Checklist
Describe the bug I trained the fcenet_r50dcnv2_fpn_1500e_ctw1500 and fcenet_r50_fpn_1500e_icdar2015 on ICDAR2015 (my custom dataset). I use the DB net for training which is successful but trained with FCENET is failed. My config log file when training model is attached here 20211123_174847.log.zip
Reproduction
or command:
Did you make any modifications on the code or config? Did you understand what you have modified?
What dataset did you use? I use format ICDAR dataset specifically ICDAR2015. Environment
Please run
python mmocr/utils/collect_env.py
to collect necessary environment information and paste it here.TorchVision: 0.8.0 OpenCV: 4.1.2 MMCV: 1.3.17 MMCV Compiler: GCC 7.5 MMCV CUDA Compiler: 11.1 MMOCR: 0.3.0+53b050b
!pip install -U torch==1.7.0+cu110 torchvision==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
Install mmcv-full thus we could use CUDA operators
!pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.6.0/index.html
Install mmdetection
!pip install mmdet %cd mmocr !pip install -r requirements.txt !pip install -v -e .
Bug fix If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated! I train DBnet (text detection) on my custom dataset is successful. But I used fcenet_r50dcnv2_fpn_1500e_ctw1500 then generated this bug above. Please help me fix that bug. Thank you.