ci-ber / THOR_DDPM

10 stars 4 forks source link

RuntimeError: Unexpected key(s) in state_dict #3

Open op1009 opened 3 weeks ago

op1009 commented 3 weeks ago

Steps done:

Error log:

INFO:root:[Configurator::train::INFO]: Model weights loaded!
INFO:root:[Configurator::train]: ################ Starting training ################
Traceback (most recent call last):
   File "/content/THOR_DDPM/core/Main.py", line 101, in <module>
     Main(config_file).setup_experiment()
   File "/content/THOR_DDPM/core/Main.py", line 60, in setup_experiment
     configurator.start_training(checkpoint)
   File "/content/THOR_DDPM/./core/Configurator.py", line 63, in start_training
     trained_model_state, trained_opt_state = self.trainer.train(model_state, opt_state, epoch)
   File "/content/THOR_DDPM/./projects/thor/DDPMTrainer.py", line 33, in train
     self.model.load_state_dict(model_state)  # load weights
   File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 2584, in load_state_dict
     raise RuntimeError(
 RuntimeError: Error(s) in loading state_dict for DDPM:
    Unexpected key(s) in state_dict: "l_pips_monai.perceptual_function.model.conv1.weight",
 "l_pips_monai.perceptual_function.model.conv1.bias",
"l_pips_monai.perceptual_function.model.bn1.weight",
 "l_pips_monai.perceptual_function.model.bn1.bias",
 "l_pips_monai.perceptual_function.model.bn1.running_mean", 
"l_pips_monai.perceptual_function.model.bn1.running_var", 
"l_pips_monai.perceptual_function.model.bn1.num_batches_tracked",
...
...
and many more in between
...
...
"l_pips_monai.perceptual_function.model.layer1.2.bn1.running_var", 
"l_pips_monai.perce"