**Error traceback**
If applicable, paste the error trackback here.
2024-10-22 15:36:34,297 - mmdet - INFO - Epoch [1][2750/3517] lr: 2.000e-04, eta: 14:59:39, time: 0.645, data_time: 0.020, memory: 7922, task0.loss_xy: 0.1238, task0.loss_z: 0.1062, task0.loss_whl: 0.2299, task0.loss_yaw: 0.3007, task0.loss_vel: 0.0611, task0.loss_heatmap: 2.2082, loss: 3.0299, grad_norm: 3.6961
Traceback (most recent call last):
File "tools/train.py", line 277, in
main()
File "tools/train.py", line 266, in main
train_model(
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/apis/train.py", line 344, in train_model
train_detector(
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/apis/train.py", line 319, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 130, in run
epoch_runner(data_loaders[i], **kwargs)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train
for i, data_batch in enumerate(self.data_loader):
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
cv2.error: Caught error in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/custom_3d.py", line 435, in getitem
data = self.prepare_train_data(idx)
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/custom_3d.py", line 229, in prepare_train_data
example = self.pipeline(input_dict)
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/pipelines/compose.py", line 49, in call
data = t(data)
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/pipelines/loading.py", line 1157, in call
results['img_inputs'] = self.get_inputs(results)
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/pipelines/loading.py", line 1105, in get_inputs
imgs.append(self.normalize_img(img))
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/pipelines/loading.py", line 853, in mmlabNormalize
img = imnormalize(np.array(img), mean, std, torgb)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/mmcv/image/photometric.py", line 22, in imnormalize
return imnormalize(img, mean, std, torgb)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/mmcv/image/photometric.py", line 43, in imnormalize
cv2.subtract(img, mean, img) # inplace
cv2.error: OpenCV(4.10.0) /io/opencv/modules/core/src/arithm.cpp:658: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'arithm_op
Thanks for your error report and we appreciate it a lot.
Checklist
Describe the bug 当我按照示例代码生成pkl文件的时候,当运行到一定的iteration的时候,会出现opencv 报错,打印出来两者的格式发现都是numpy的形式
Environment
python mmdet3d/utils/collect_env.py
to collect necessary environment information and paste it here.$PATH
,$LD_LIBRARY_PATH
,$PYTHONPATH
, etc.)TorchVision: 0.11.0+cu113 OpenCV: 4.10.0 MMCV: 1.5.3 MMCV Compiler: GCC 7.3 MMCV CUDA Compiler: 11.3 MMDetection: 2.25.1 MMSegmentation: 0.25.0 MMDetection3D: 1.0.0rc4+26144be spconv2.0: True
2024-10-22 15:36:34,297 - mmdet - INFO - Epoch [1][2750/3517] lr: 2.000e-04, eta: 14:59:39, time: 0.645, data_time: 0.020, memory: 7922, task0.loss_xy: 0.1238, task0.loss_z: 0.1062, task0.loss_whl: 0.2299, task0.loss_yaw: 0.3007, task0.loss_vel: 0.0611, task0.loss_heatmap: 2.2082, loss: 3.0299, grad_norm: 3.6961 Traceback (most recent call last): File "tools/train.py", line 277, in
main()
File "tools/train.py", line 266, in main
train_model(
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/apis/train.py", line 344, in train_model
train_detector(
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/apis/train.py", line 319, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 130, in run
epoch_runner(data_loaders[i], **kwargs)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train
for i, data_batch in enumerate(self.data_loader):
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
cv2.error: Caught error in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/custom_3d.py", line 435, in getitem
data = self.prepare_train_data(idx)
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/custom_3d.py", line 229, in prepare_train_data
example = self.pipeline(input_dict)
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/pipelines/compose.py", line 49, in call
data = t(data)
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/pipelines/loading.py", line 1157, in call
results['img_inputs'] = self.get_inputs(results)
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/pipelines/loading.py", line 1105, in get_inputs
imgs.append(self.normalize_img(img))
File "/mnt/home/Code/BEV/BEVDet/mmdet3d/datasets/pipelines/loading.py", line 853, in mmlabNormalize
img = imnormalize(np.array(img), mean, std, torgb)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/mmcv/image/photometric.py", line 22, in imnormalize
return imnormalize(img, mean, std, torgb)
File "/mnt/home/anaconda3/envs/bevdet/lib/python3.8/site-packages/mmcv/image/photometric.py", line 43, in imnormalize
cv2.subtract(img, mean, img) # inplace
cv2.error: OpenCV(4.10.0) /io/opencv/modules/core/src/arithm.cpp:658: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'arithm_op