3dlg-hcvc / omages

We present Object Images (Omages): An homage to the classic Geometry Images.
MIT License
258 stars 12 forks source link

Usage error #3

Open jxxtin opened 3 months ago

jxxtin commented 3 months ago

Hello,

I downloaded the pre-trained script using python setup/download_ckpts.py.

when I tried to run the sampling code with the following command: python -m src.trainer --opts src/models/omages64_DiT/cfgs/pipeline_N2G2M.yaml --gpus 0 --mode 'test'

I got the following error

Could you please provide some guidance on how to resolve this?

/root/anaconda3/envs/omages/lib/python3.9/site-packages/huggingface_hub/file_download.py:1150: FutureWarning: resume_download is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use force_download=True.
  warnings.warn(

  File "/root/projects/omages/src/trainer.py", line 87, in __init__
    self.load_callbacks()
  File "/root/projects/omages/src/trainer.py", line 152, in load_callbacks
    callback = cb_class(**cb_kwargs)
  File "/root/projects/omages/src/models/omages64_DiT/pl_N2G2M_pipeline.py", line 61, in __init__
    self.G2M_module = cfg2model(G2M_cfg, G2M_ckpt)
  File "/root/projects/omages/src/models/omages64_DiT/pl_N2G2M_pipeline.py", line 52, in cfg2model
    model.load_state_dict(torch.load(ckpt_path, map_location=model.device)['state_dict'])
  File "/root/anaconda3/envs/omages/lib/python3.9/site-packages/torch/nn/modules/module.py", line 2041, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Model:
        Missing key(s) in state_dict: "unets.downs.0.1.block1.norm.gamma", "unets.downs.0.1.block2.norm.gamma", "unets.downs.0.2.0.block1.norm.gamma", "unets.downs.0.2.0.block2.norm.gamma", "unets.downs.0.2.1.block1.norm.gamma", "unets.downs.0.2.1.block2.norm.gamma", "unets.downs.0.2.2.block1.norm.gamma", "unets.downs.0.2.2.block2.norm.gamma", "unets.downs.1.1.block1.norm.gamma", "unets.downs.1.1.block2.norm.gamma", "unets.downs.1.2.0.block1.norm.gamma", "unets.downs.1.2.0.block2.norm.gamma", "unets.downs.1.2.1.block1.norm.gamma", "unets.downs.1.2.1.block2.norm.gamma", "unets.downs.1.2.2.block1.norm.gamma", "unets.downs.1.2.2.block2.norm.gamma", "unets.downs.2.1.block1.norm.gamma", "unets.downs.2.1.block2.norm.gamma", "unets.downs.2.2.0.block1.norm.gamma", "unets.downs.2.2.0.block2.norm.gamma", "unets.downs.2.2.1.block1.norm.gamma", "unets.downs.2.2.1.block2.norm.gamma", "unets.downs.2.2.2.block1.norm.gamma", "unets.downs.2.2.2.block2.norm.gamma", "unets.downs.3.1.block1.norm.gamma", "unets.downs.3.1.block2.norm.gamma", "unets.downs.3.2.0.block1.norm.gamma", "unets.downs.3.2.0.block2.norm.gamma", "unets.downs.3.2.1.block1.norm.gamma", "unets.downs.3.2.1.block2.norm.gamma", "unets.downs.3.2.2.block1.norm.gamma", "unets.downs.3.2.2.block2.norm.gamma", "unets.ups.0.0.block1.norm.gamma", "unets.ups.0.0.block2.norm.gamma", "unets.ups.0.1.0.block1.norm.gamma", "unets.ups.0.1.0.block2.norm.gamma", "unets.ups.0.1.1.block1.norm.gamma", "unets.ups.0.1.1.block2.norm.gamma", "unets.ups.0.1.2.block1.norm.gamma", "unets.ups.0.1.2.block2.norm.gamma", "unets.ups.1.0.block1.norm.gamma", "unets.ups.1.0.block2.norm.gamma", "unets.ups.1.1.0.block1.norm.gamma", "unets.ups.1.1.0.block2.norm.gamma", "unets.ups.1.1.1.block1.norm.gamma", "unets.ups.1.1.1.block2.norm.gamma", "unets.ups.1.1.2.block1.norm.gamma", "unets.ups.1.1.2.block2.norm.gamma", "unets.ups.2.0.block1.norm.gamma", "unets.ups.2.0.block2.norm.gamma", "unets.ups.2.1.0.block1.norm.gamma", "unets.ups.2.1.0.block2.norm.gamma", "unets.ups.2.1.1.block1.norm.gamma", "unets.ups.2.1.1.block2.norm.gamma", "unets.ups.2.1.2.block1.norm.gamma", "unets.ups.2.1.2.block2.norm.gamma", "unets.ups.3.0.block1.norm.gamma", "unets.ups.3.0.block2.norm.gamma", "unets.ups.3.1.0.block1.norm.gamma", "unets.ups.3.1.0.block2.norm.gamma", "unets.ups.3.1.1.block1.norm.gamma", "unets.ups.3.1.1.block2.norm.gamma", "unets.ups.3.1.2.block1.norm.gamma", "unets.ups.3.1.2.block2.norm.gamma", "unets.mid_block1.block1.norm.gamma", "unets.mid_block1.block2.norm.gamma", "unets.mid_block2.block1.norm.gamma", "unets.mid_block2.block2.norm.gamma", "unets.final_res_block.block1.norm.gamma", "unets.final_res_block.block2.norm.gamma", "imagen.unets.0.downs.0.1.block1.norm.gamma", "imagen.unets.0.downs.0.1.block2.norm.gamma", "imagen.unets.0.downs.0.2.0.block1.norm.gamma", "imagen.unets.0.downs.0.2.0.block2.norm.gamm
, "imagen.unets.0.downs.0.2.1.block1.norm.gamma", "imagen.unets.0.downs.0.2.1.block2.norm.gamma", "imagen.unets.0.downs.0.2.2.block1.norm.gamma", "imagen.unets.0.downs.0.2.2.block2.norm.gamma", "imagen.unets.0.downs.1.1.block1.norm.gamma", "imagen.unets.0.downs.1.1.block2.norm.gamma", "imagen.unets.0.downs.1.2.0.block1.norm.gamma", "imagen.unets.0.downs.1.2.0.block2.norm.gamma", "imagen.unets.0.downs.1.2.1.block1.norm.gamma", "imagen.unets.0.downs.1.2.1.block2.norm.gamma", "imagen.unets.0.downs.1.2.2.block1.norm.gamma", "imagen.unets.0.downs.1.2.2.block2.norm.gamma", "imagen.unets.0.downs.2.1.block1.norm.gamma", "imagen.unets.0.downs.2.1.block2.norm.gamma", "imagen.unets.0.downs.2.2.0.block1.norm.gamma", "imagen.unets.0.downs.2.2.0.block2.norm.gamma", "imagen.unets.0.downs.2.2.1.block1.norm.gamma", "imagen.unets.0.downs.2.2.1.block2.norm.gamma", "imagen.unets.0.downs.2.2.2.block1.norm.gamma", "imagen.unets.0.downs.2.2.2.block2.norm.gamma", "imagen.unets.0.downs.3.1.block1.norm.gamma", "imagen.unets.0.downs.3.1.block2.norm.gamma", "imagen.unets.0.downs.3.2.0.block1.norm.gamma", "imagen.unets.0.downs.3.2.0.block2.norm.gamma", "imagen.unets.0.downs.3.2.1.block1.norm.gamma", "imagen.unets.0.downs.3.2.1.block2.norm.gamma", "imagen.unets.0.downs.3.2.2.block1.norm.gamma", "imagen.unets.0.downs.3.2.2.block2.norm.gamma", "imagen.unets.0.ups.0.0.block1.norm.gamma", "imagen.unets.0.ups.0.0.block2.norm.gamma", "imagen.unets.0.ups.0.1.0.block1.norm.gamma", "imagen.unets.0.ups.0.1.0.block2.norm.gamma", "imagen.unets.0.ups.0.1.1.block1.norm.gamma", "imagen.unets.0.ups.0.1.1.block2.norm.gamma", "imagen.unets.0.ups.0.1.2.block1.norm.gamma", "imagen.unets.0.ups.0.1.2.block2.norm.gamma", "imagen.unets.0.ups.1.0.block1.norm.gamma", "imagen.unets.0.ups.1.0.block2.norm.gamma", "imagen.unets.0.ups.1.1.0.block1.norm.gamma", "imagen.unets.0.ups.1.1.0.block2.norm.gamma", "imagen.unets.0.ups.1.1.1.block1.norm.gamma", "imagen.unets.0.ups.1.1.1.block2.norm.gamma", "imagen.unets.0.ups.1.1.2.block1.norm.gamma", "imagen.unets.0.ups.1.1.2.block2.norm.gamma", "imagen.unets.0.ups.2.0.block1.norm.gamma", "imagen.unets.0.ups.2.0.block2.norm.gamma", "imagen.unets.0.ups.2.1.0.block1.norm.gamma", "imagen.unets.0.ups.2.1.0.block2.norm.gamma", "imagen.unets.0.ups.2.1.1.block1.norm.gamma", "imagen.unets.0.ups.2.1.1.block2.norm.gamma", "imagen.unets.0.ups.2.1.2.block1.norm.gamma", "imagen.unets.0.ups.2.1.2.block2.norm.gamma", "imagen.unets.0.ups.3.0.block1.norm.gamma", "imagen.unets.0.ups.3.0.block2.norm.gamma", "imagen.unets.0.ups.3.1.0.block1.norm.gamma", "imagen.unets.0.ups.3.1.0.block2.norm.gamma", "imagen.unets.0.ups.3.1.1.block1.norm.gamma", "imagen.unets.0.ups.3.1.1.block2.norm.gamma", "imagen.unets.0.ups.3.1.2.block1.norm.gamma", "imagen.unets.0.ups.3.1.2.block2.norm.gamma", "imagen.unets.0.mid_block1.block1.norm.gamma", "imagen.unets.0.mid_block1.block2.norm.gamma", "imagen.unets.0.mid_block2.block1.norm.gamma", "imagen.unets.0.mid_block2.block2.norm.gamma", "imagen.unets.0.final_res_block.block1.norm.gamma", "imagen.unets.0.final_res_block.block2.norm.gamma", "model.unets.0.downs.0.1.block1.norm.gamma", "model.unets.0.downs.0.1.block2.norm.gamma", "model.unets.0.downs.0.2.0.block1.norm.gamma", "model.unets.0.downs.0.2.0.block2.norm.gamma", "model.unets.0.downs.0.2.1.block1.norm.gamma", "model.unets.0.downs.0.2.1.block2.norm.gamma", "model.unets.0.downs.0.2.2.block1.norm.gamma", "model.unets.0.downs.0.2.2.block2.norm.gamma", "model.unets.0.downs.1.1.block1.norm.gamma", "model.unets.0.downs.1.1.block2.norm.gamma", "model.unets.0.downs.1.2.0.block1.norm.gamma", "model.unets.0.downs.1.2.0.block2.norm.gamma", "model.unets.0.downs.1.2.1.block1.norm.gamma", "model.unets.0.downs.1.2.1.block2.norm.gamma", "model.unets.0.downs.1.2.2.block1.norm.gamma", "model.unets.0.downs.1.2.2.block2.norm.gamma", "model.unets.0.downs.2.1.block1.norm.gamma", "model.unets.0.downs.2.1.block2.norm.gamma", "model.unets.0.downs.2.2.0.block1.norm.gamma", "model.unets.0.downs.2.2.0.block2.norm.gamma", "model.unets.0.downs.2.2.1.block1.norm.gamma", "model.unets.0.downs.2.2.1.block2.no
", "model.unets.0.downs.3.1.block2.norm.gamma", "model.unets.0.downs.3.2.0.block1.norm.gamma", "model.unets.0.downs.3.2.0.block2.norm.gamma", "model.unets.0.downs.3.2.1.block1.norm.gamma", "model.unets.0.downs.3.2.1.block2.norm.gamma", "model.unets.0.downs.3.2.2.block1.norm.gamma", "model.unets.0.downs.3.2.2.block2.norm.gamma", "model.unets.0.ups.0.0.block1.norm.gamma", "model.unets.0.ups.0.0.block2.norm.gamma", "model.unets.0.ups.0.1.0.block1.norm.gamma", "model.unets.0.ups.0.1.0.block2.norm.gamma", "model.unets.0.ups.0.1.1.block1.norm.gamma", "model.unets.0.ups.0.1.1.block2.norm.gamma", "model.unets.0.ups.0.1.2.block1.norm.gamma", "model.unets.0.ups.0.1.2.block2.norm.gamma", "model.unets.0.ups.1.0.block1.norm.gamma", "model.unets.0.ups.1.0.block2.norm.gamma", "model.unets.0.ups.1.1.0.block1.norm.gamma", "model.unets.0.ups.1.1.0.block2.norm.gamma", "model.unets.0.ups.1.1.1.block1.norm.gamma", "model.unets.0.ups.1.1.1.block2.norm.gamma", "model.unets.0.ups.1.1.2.block1.norm.gamma", "model.unets.0.ups.1.1.2.block2.norm.gamma", "model.unets.0.ups.2.0.block1.norm.gamma", "model.unets.0.ups.2.0.block2.norm.gamma", "model.unets.0.ups.2.1.0.block1.norm.gamma", "model.unets.0.ups.2.1.0.block2.norm.gamma", "model.unets.0.ups.2.1.1.block1.norm.gamma", "model.unets.0.ups.2.1.1.block2.norm.gamma", "model.unets.0.ups.2.1.2.block1.norm.gamma", "model.unets.0.ups.2.1.2.block2.norm.gamma", "model.unets.0.ups.3.0.block1.norm.gamma", "model.unets.0.ups.3.0.block2.norm.gamma", "model.unets.0.ups.3.1.0.block1.norm.gamma", "model.unets.0.ups.3.1.0.block2.norm.gamma", "model.unets.0.ups.3.1.1.block1.norm.gamma", "model.unets.0.ups.3.1.1.block2.norm.gamma", "model.unets.0.ups.3.1.2.block1.norm.gamma", "model.unets.0.ups.3.1.2.block2.norm.gamma", "model.unets.0.mid_block1.block1.norm.gamma", "model.unets.0.mid_block1.block2.norm.gamma", "model.unets.0.mid_block2.block1.norm.gamma", "model.unets.0.mid_block2.block2.norm.gamma", "model.unets.0.final_res_block.block1.norm.gamma", "model.unets.0.final_res_block.block2.norm.gamma".
        Unexpected key(s) in state_dict: "unets.downs.0.1.block1.groupnorm.weight", "unets.downs.0.1.block1.groupnorm.bias", "unets.downs.0.1.block2.groupnorm.weight", "unets.downs.0.1.block2.groupnorm.bias", "unets.downs.0.2.0.block1.groupnorm.weight", "unets.downs.0.2.0.block1.groupnorm.bias", "unets.downs.0.2.0.block2.groupnorm.weight", "unets.downs.0.2.0.block2.groupnorm.bias", "unets.downs.0.2.1.block1.groupnorm.weight", "unets.downs.0.2.1.block1.groupnorm.bias", "unets.downs.0.2.1.block2.groupnorm.weight", "unets.downs.0.2.1.block2.groupnorm.bias", "unets.downs.0.2.2.block1.groupnorm.weight", "unets.downs.0.2.2.block1.groupnorm.bias", "unets.downs.0.2.2.block2.groupnorm.weight", "unets.downs.0.2.2.block2.groupnorm.bias", "unets.downs.1.1.block1.groupnorm.weight", "unets.downs.1.1.block1.groupnorm.bias", "unets.downs.1.1.block2.groupnorm.weight", "unets.downs.1.1.block2.groupnorm.bias", "unets.downs.1.2.0.block1.groupnorm.weight", "unets.downs.1.2.0.block1.groupnorm.bias", "unets.downs.1.2.0.block2.groupnorm.weight", "unets.downs.1.2.0.block2.groupnorm.bias", "unets.downs.1.2.1.block1.groupnorm.weight", "unets.downs.1.2.1.block1.groupnorm.bias", "unets.downs.1.2.1.block2.groupnorm.weight", "unets.downs.1.2.1.block2.groupnorm.bias", "unets.downs.1.2.2.block1.groupnorm.weight", "unets.downs.1.2.2.block1.groupnorm.bias", "unets.downs.1.2.2.block2.groupnorm.weight", "unets.downs.1.2.2.block2.groupnorm.bias", "unets.downs.2.1.block1.groupnorm.weight", 
QhelDIV commented 3 months ago

Hi jxxtin, I retested the script and did not encounter this problem. I guess the cause of this may be that the ckpt you downloaded is corrupted. The ckpt file for geo2mat_imagen should have 6.2G

journey-zhuang commented 2 months ago

I meet this problem too, and I download the ckpt again, the problem also exist. My solution is: "model.load_state_dict(torch.load(ckpt_path, map_location=model.device)['state_dict'], False)", I'm not sure if this is a side-effect solution, but it does ignore the problem.