Megvii-BaseDetection / BEVDepth

Official code for BEVDepth.
MIT License
730 stars 101 forks source link

train error about MatrixVT config #131

Closed MaRongbo closed 1 year ago

MaRongbo commented 1 year ago

python bevdepth/exps/nuscenes/MatrixVT/matrixvt_bev_depth_lss_r50_256x704_128x128_24e_ema.py --amp_backend native -b 8--gpus 8

self._optimizer_step(optimizer, opt_idx, batch_idx, closure) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py", line 369, in _optimizer_step self.trainer._call_lightning_module_hook( File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1596, in _call_lightning_module_hook output = fn(args, kwargs) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/core/lightning.py", line 1625, in optimizer_step optimizer.step(closure=optimizer_closure) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/core/optimizer.py", line 168, in step step_output = self._strategy.optimizer_step(self._optimizer, self._optimizer_idx, closure, kwargs) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/strategies/ddp.py", line 278, in optimizer_step optimizer_output = super().optimizer_step(optimizer, opt_idx, closure, model, kwargs) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/strategies/strategy.py", line 193, in optimizer_step return self.precision_plugin.optimizer_step(model, optimizer, opt_idx, closure, kwargs) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/plugins/precision/native_amp.py", line 85, in optimizer_step closure_result = closure() File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py", line 148, in call self._result = self.closure(args, kwargs) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py", line 134, in closure step_output = self._step_fn() File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py", line 427, in _training_step training_step_output = self.trainer._call_strategy_hook("training_step", step_kwargs.values()) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1766, in _call_strategy_hook output = fn(args, kwargs) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/strategies/ddp.py", line 344, in training_step return self.model(*args, kwargs) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 886, in forward output = self.module(inputs[0], kwargs[0]) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, kwargs) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/pytorch_lightning/overrides/base.py", line 82, in forward output = self.module.training_step(*inputs, *kwargs) File "/home/rongbo.ma/code/BEVDepth/bevdepth/exps/nuscenes/base_exp.py", line 249, in training_step preds, depth_preds = self(sweep_imgs, mats) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/home/rongbo.ma/code/BEVDepth/bevdepth/exps/nuscenes/base_exp.py", line 239, in forward return self.model(sweep_imgs, mats) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, kwargs) File "/home/rongbo.ma/code/BEVDepth/bevdepth/models/base_bev_depth.py", line 60, in forward preds = self.head(x) File "/home/rongbo.ma/anaconda3/envs/mm3d-master/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1177, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'MatrixVT_Det' object has no attribute 'head'** Epoch 0: 0%| | 0/132410 [00:20<?, ?it/s]

ZRandomize commented 1 year ago

I'm sorry for the bug, this bug is caused by skipped init of BEVDepth, please try this

MaRongbo commented 1 year ago

many thanks~