vidit09/domaingen

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

xinxuand opened this issue · 2 comments

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'

I meet the same question after 4999 iter. OK solve . this solution works : #3 (comment)

Maybe this solution works: link