Megvii-BaseDetection / BEVDepth

Official code for BEVDepth.
MIT License
688 stars 96 forks source link

EMA bug #107

Closed LeopoldACC closed 1 year ago

LeopoldACC commented 1 year ago

when I set use_ema=True in run_cli(), the error is shown as below.So the ema is not supported in the version of pytorch lightning?

  File "/data/BEVDepth/callbacks/ema.py", line 82, in on_fit_start                               
    callback.on_fit_start(self, self.lightning_module)
  File "/data/BEVDepth/callbacks/ema.py", line 82, in on_fit_start
    trainer.ema_model = ModelEMA(trainer.model.module.module.model.cuda(),
  File "/home/gongzheng/anaconda3/envs/bev/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1
131, in __getattr__
    trainer.ema_model = ModelEMA(trainer.model.module.module.model.cuda(),
  File "/home/gongzheng/anaconda3/envs/bev/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1
131, in __getattr__                                                                                       
    type(self).__name__, name))                                                                           
AttributeError: 'BEVDepthLightningModel' object has no attribute 'module' 
    type(self).__name__, name))                                                                           
yinchimaoliang commented 1 year ago

Please check if you have installed the right version of pytorch and pl.

LeopoldACC commented 1 year ago

due to python version is 3.6, pl can not install >=1.6.0 version, the issue is the pl's version, thanks~