Skip to content

TypeError: can only concatenate list (not "tuple") to list #264

@Ibrah-N

Description

@Ibrah-N

问题确认 Search before asking

  • 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

No response

Bug描述 Describe the Bug

I'm training the paddledetection yolox_m_300e_coco.yml model with these configuration but there certain thing that when I change the model start giving me this error:
parameters I changed
the worker set to 1; batch_size 2 and input shape 2048x2048;
for original configuration it was working fine but changing the mentioned params causes issues.

'''shel
!python tools/train.py -c configs/yolox/yolox_m_300e_coco.yml --eval
''''

yolox_m_300e_coco.yml
worker_num: 1
TrainReader:
sample_transforms:
- Decode: {}
- Mosaic:
prob: 1.0
input_dim: [2048, 2048]
degrees: [-10, 10]
scale: [0.1, 2.0]
shear: [-2, 2]
translate: [-0.1, 0.1]
enable_mixup: True
mixup_prob: 1.0
mixup_scale: [0.5, 1.5]
- AugmentHSV: {is_bgr: False, hgain: 5, sgain: 30, vgain: 30}
- PadResize: {target_size: 2048}
- RandomFlip: {}
batch_transforms:
- Permute: {}
batch_size: 2
shuffle: True
drop_last: True
collate_batch: False
mosaic_epoch: 285

EvalReader:
sample_transforms:
- Decode: {}
- Resize: {target_size: [2048, 2048], keep_ratio: True, interp: 1}
- Pad: {size: [2048, 2048], fill_value: [114., 114., 114.]}
- Permute: {}
batch_size: 2

yolox_cspdarknet.yml
architecture: YOLOX
norm_type: sync_bn
use_ema: True
ema_decay: 0.9999
ema_decay_type: "exponential"
act: silu
find_unused_parameters: True

depth_mult: 1.0
width_mult: 1.0

YOLOX:
backbone: CSPDarkNet
neck: YOLOCSPPAN
head: YOLOXHead
size_stride: 32
size_range: [7, 7] # multi-scale range [480480 ~ 800800]

issues or error:
[04/15 13:26:10] ppdet.utils.checkpoint INFO: Skipping import of the encryption module.
loading annotations into memory...
Done (t=0.15s)
creating index...
index created!
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_00dg__rot_00dg__f7610a0e-images-30.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_00dg__rot_00dg__c0df3b9f-images-34.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_00dg__rot_00dg__9d1ffa4e-images-60.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_00dg__rot_00dg__3ea854bd-images-61.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_00dg__rot_00dg__3d2569f1-images-68.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_00dg__rot_00dg__732683ad-images-71.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_00dg__rot_00dg__a658321d-images-96.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90ac__rot_90ac__f7610a0e-images-30.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90ac__rot_90ac__c0df3b9f-images-34.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90ac__rot_90ac__9d1ffa4e-images-60.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90ac__rot_90ac__3ea854bd-images-61.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90ac__rot_90ac__3d2569f1-images-68.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90ac__rot_90ac__732683ad-images-71.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90ac__rot_90ac__a658321d-images-96.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90cw__rot_90cw__f7610a0e-images-30.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90cw__rot_90cw__c0df3b9f-images-34.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90cw__rot_90cw__9d1ffa4e-images-60.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90cw__rot_90cw__3ea854bd-images-61.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90cw__rot_90cw__3d2569f1-images-68.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90cw__rot_90cw__732683ad-images-71.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco WARNING: Illegal image file: combine_images/train2017/rot_90cw__rot_90cw__a658321d-images-96.jpg, and it will be ignored
[04/15 13:26:10] ppdet.data.source.coco INFO: Load [584 samples valid, 21 samples invalid] in file combine_images/annotations/train2017.json.
W0415 13:26:10.951642 3186 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 12.4, Runtime API Version: 11.8
W0415 13:26:10.976188 3186 gpu_resources.cc:164] device: 0, cuDNN Version: 9.2.
[04/15 13:26:17] ppdet.engine.callbacks INFO: Epoch: [0] [ 0/292] learning_rate: 0.000000 loss: 13.831890 loss_cls: 2.004071 loss_obj: 7.930847 loss_iou: 0.779394 loss_l1: 0.000000 size: 576.000000 eta: 5 days, 13:17:13 batch_cost: 5.4776 data_cost: 1.8600 ips: 0.3651 images/s, max_mem_reserved: 1774 MB, max_mem_allocated: 1685 MB
Traceback (most recent call last):
File "/content/PaddleDetection/tools/train.py", line 212, in
main()
File "/content/PaddleDetection/tools/train.py", line 208, in main
run(FLAGS, cfg)
File "/content/PaddleDetection/tools/train.py", line 161, in run
trainer.train(FLAGS.eval)
File "/content/PaddleDetection/ppdet/engine/trainer.py", line 633, in train
outputs = model(data)
^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/paddle/nn/layer/layers.py", line 1429, in call
return self.forward(*inputs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/PaddleDetection/ppdet/modeling/architectures/meta_arch.py", line 60, in forward
out = self.get_loss()
^^^^^^^^^^^^^^^
File "/content/PaddleDetection/ppdet/modeling/architectures/yolox.py", line 105, in get_loss
return self._forward()
^^^^^^^^^^^^^^^
File "/content/PaddleDetection/ppdet/modeling/architectures/yolox.py", line 95, in _forward
yolox_losses = self.head(neck_feats, self.inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/paddle/nn/layer/layers.py", line 1429, in call
return self.forward(*inputs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/PaddleDetection/ppdet/modeling/heads/yolo_head.py", line 299, in forward
yolox_losses = self.get_loss([
^^^^^^^^^^^^^^^
File "/content/PaddleDetection/ppdet/modeling/heads/yolo_head.py", line 321, in get_loss
pos_num, label, _, bbox_target = self.assigner(
^^^^^^^^^^^^^^
File "/content/PaddleDetection/ppdet/modeling/assigners/simota_assigner.py", line 191, in call
pairwise_ious = batch_bbox_overlaps(valid_flatten_bboxes,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/PaddleDetection/ppdet/modeling/bbox_utils.py", line 284, in batch_bbox_overlaps
return paddle.full(batch_shape + (rows, cols), 1)
~~~~~~~~~~~~^~~~~~~~~~~~~~
TypeError: can only concatenate list (not "tuple") to list

CSPDarkNet:
arch: "X"
return_idx: [2, 3, 4]
depthwise: False

YOLOCSPPAN:
depthwise: False

YOLOXHead:
l1_epoch: 285
depthwise: False
loss_weight: {cls: 1.0, obj: 1.0, iou: 5.0, l1: 1.0}
assigner:
name: SimOTAAssigner
candidate_topk: 10
use_vfl: False
nms:
name: MultiClassNMS
nms_top_k: 10000
keep_top_k: 1000
score_threshold: 0.001
nms_threshold: 0.65
# For speed while keep high mAP, you can modify 'nms_top_k' to 1000 and 'keep_top_k' to 100, the mAP will drop about 0.1%.
# For high speed demo, you can modify 'score_threshold' to 0.25 and 'nms_threshold' to 0.45, but the mAP will drop a lot.

复现环境 Environment

colab notebook

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions