MCG-NJU / SparseOcc

[ECCV 2024] Fully Sparse 3D Occupancy Prediction & RayIoU Evaluation Metric
https://arxiv.org/abs/2312.17118
Apache License 2.0
277 stars 22 forks source link

参数r50_nuimg_704x256_8f_openocc.py的训练报错 #59

Open TJW2410 opened 1 month ago

TJW2410 commented 1 month ago

[2024-10-21 09:36:33,704][INFO] - workflow: [('train', 1)], max: 24 epochs [2024-10-21 09:36:33,704][INFO] - Checkpoints will be saved to /home/zpj/SparseOcc-main/SparseOcc-main/outputs/SparseOcc/2 by HardDiskBackend. Traceback (most recent call last): File "train.py", line 181, in main() File "train.py", line 177, in main runner.run([train_loader], [('train', 1)]) File "/home/zpj/anaconda3/envs/sparseocc/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 136, in run epoch_runner(data_loaders[i], kwargs) File "/home/zpj/anaconda3/envs/sparseocc/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 53, in train self.run_iter(data_batch, train_mode=True, kwargs) File "/home/zpj/anaconda3/envs/sparseocc/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 31, in run_iter outputs = self.model.train_step(data_batch, self.optimizer, File "/home/zpj/anaconda3/envs/sparseocc/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py", line 77, in train_step return self.module.train_step(inputs[0], kwargs[0]) File "/home/zpj/anaconda3/envs/sparseocc/lib/python3.8/site-packages/mmdet/models/detectors/base.py", line 248, in train_step losses = self(data) File "/home/zpj/anaconda3/envs/sparseocc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(input, kwargs) File "/home/zpj/SparseOcc-main/SparseOcc-main/models/sparseocc.py", line 121, in forward return self.forward_train(kwargs) File "/home/zpj/anaconda3/envs/sparseocc/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 205, in new_func return old_func(*args, kwargs) File "/home/zpj/SparseOcc-main/SparseOcc-main/models/sparseocc.py", line 128, in forward_train return self.forward_pts_train(img_feats, voxel_semantics, voxel_instances, instance_class_ids, mask_camera, img_metas) File "/home/zpj/SparseOcc-main/SparseOcc-main/models/sparseocc.py", line 117, in forward_pts_train return self.pts_bbox_head.loss(loss_inputs) File "/home/zpj/anaconda3/envs/sparseocc/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 205, in new_func return old_func(args, kwargs) File "/home/zpj/SparseOcc-main/SparseOcc-main/models/sparseocc_head.py", line 60, in loss return self.loss_single(voxel_semantics, voxel_instances, instance_class_ids, preds_dicts, mask_camera) File "/home/zpj/SparseOcc-main/SparseOcc-main/models/sparseocc_head.py", line 89, in loss_single loss_dict_i_b['loss_geo_scal'] = self.criterions['loss_geo_scal'](seg_pred_i_sparse, voxel_semantics_sparse)
File "/home/zpj/anaconda3/envs/sparseocc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/home/zpj/SparseOcc-main/SparseOcc-main/models/lossutils.py", line 97, in forward loss, = compute_scal_loss(pred, gt, self.num_classes - 1, reverse=True) File "/home/zpj/SparseOcc-main/SparseOcc-main/models/loss_utils.py", line 35, in compute_scal_loss p = pred[:, class_id, :] IndexError: index 17 is out of bounds for dimension 1 with size 17

afterthat97 commented 1 month ago

别用openocc的那个config了,那个有bug,我也懒得修了,用occ3d吧