NVlabs / GLAMR

[CVPR 2022 Oral] Official PyTorch Implementation of "GLAMR: Global Occlusion-Aware Human Mesh Recovery with Dynamic Cameras”.
https://nvlabs.github.io/GLAMR
Other
359 stars 33 forks source link

TypeError: __init__() got multiple values for argument 'cfg' #43

Closed JackYu6 closed 7 months ago

JackYu6 commented 7 months ago

When I ran the demo using

python global_recon/run_demo.py --cfg glamr_dynamic \
                                --video_path assets/dynamic/running.mp4 \
                                --out_dir out/glamr_dynamic/running \
                                --save_video

I encountered the following error:

  File "/home/user/GLAMR/global_recon/run_demo.py", line 59, in <module>
    grecon_model = model_dict[cfg.grecon_model_name](cfg, device, log)
  File "/home/user/GLAMR/global_recon/models/global_recon_model.py", line 67, in __init__
    self.load_model()
  File "/home/user/GLAMR/global_recon/models/global_recon_model.py", line 72, in load_model
    self.mt_model = MotionTrajJointModel(self.mt_cfg, self.device, self.log)
  File "/home/user/GLAMR/motion_infiller/models/motion_traj_joint_model.py", line 29, in __init__
    self.load_motion_infiller()
  File "/home/user/GLAMR/motion_infiller/models/motion_traj_joint_model.py", line 44, in load_motion_infiller
    self.mfiller = mfiller_model_dict[self.mfiller_cfg.model_name].load_from_checkpoint(model_cp, cfg=self.mfiller_cfg, strict=False)
  File "/home/user/anaconda3/envs/hybrik/lib/python3.9/site-packages/pytorch_lightning/core/saving.py", line 169, in load_from_checkpoint
    model = cls._load_model_state(checkpoint, *args, **kwargs)
  File "/home/user/anaconda3/envs/hybrik/lib/python3.9/site-packages/pytorch_lightning/core/saving.py", line 205, in _load_model_state
    model = cls(*cls_args, **cls_kwargs)
TypeError: __init__() got multiple values for argument 'cfg'

Before this, I referred to Making GLAMR actually work and solving all errors! to configure the environment and did not modify the code. Can someone help me?

irenebae0329 commented 7 months ago

you may refer to this one https://github.com/Lightning-AI/pytorch-lightning/issues/2550

JackYu6 commented 7 months ago

you may refer to this one Lightning-AI/pytorch-lightning#2550

Thanks for your reply. Based on the information you provided, I use a workaround with reference to this, and it works!Hope this helpful for those who meet the same error.