vidit09 / domaingen

CLIP the Gap CVPR 2023
62 stars 6 forks source link

AttributeError: 'tuple' object has no attribute 'state_dict' #15

Open xinxuand opened 6 months ago

xinxuand commented 6 months ago

Traceback (most recent call last): File "/root/detectron2/detectron2/engine/train_loop.py", line 150, in train self.after_step() File "/root/detectron2/detectron2/engine/train_loop.py", line 180, in after_step h.after_step() File "/root/detectron2/detectron2/engine/hooks.py", line 298, in after_step self._best_checking() File "/root/detectron2/detectron2/engine/hooks.py", line 271, in _best_checking self._checkpointer.save(f"{self._file_prefix}", **additional_state) File "/root/miniconda3/lib/python3.8/site-packages/fvcore/common/checkpoint.py", line 118, in save data[key] = obj.state_dict() File "/root/domaingen-main/train.py", line 429, in state_dict ret = super().state_dict() File "/root/detectron2/detectron2/engine/defaults.py", line 498, in state_dict ret["_trainer"] = self._trainer.state_dict() File "/root/detectron2/detectron2/engine/train_loop.py", line 367, in state_dict ret["optimizer"] = self.optimizer.state_dict() AttributeError: 'tuple' object has no attribute 'state_dict'

ouyang11111 commented 6 months ago

I meet the same question after 4999 iter. OK solve . this solution works : https://github.com/vidit09/domaingen/issues/3#issuecomment-1837803303

zhangletian2 commented 5 months ago

Maybe this solution works: link