Skip to content

Cannot Use Real DRCT GAN Weights for Inference — "Missing keys in state_dict" Error #44

@DanilaAniva

Description

@DanilaAniva

Issue:

I'm trying to run inference with the Real DRCT GAN weights, but I'm facing an issue when loading the model with the following command:

bash
python inference.py --input "input_dir" --output "output_dir" --model_path experiments/pretrained_models/Real_DRCT_GAN_SRx4/Real_DRCT_GAN_SRx4_finetuned_from_mse_net_g_latest

However, I receive this error:

RuntimeError: Error(s) in loading state_dict for DRCT:
        Missing key(s) in state_dict: "layers.6.swin1.norm1.weight"

Problem description

It looks like the GAN weights (Real_DRCT_GAN_SRx4_finetuned_from_mse_net_g_latest) are not compatible with the DRCT model architecture used in inference.py. The state_dict in the GAN checkpoint seems to have different keys and/or structure, resulting in missing keys when trying to load them into the DRCT model.

Questions

  • What is the correct way to perform inference using the "Real DRCT" GAN weights?
  • Should I be using a different architecture or script (other than inference.py) for these specific weights?
  • Do you have an example code snippet or pipeline for inference with the Real DRCT GAN models (.pth, not ONNX)?
  • I saw ONNX inference script for this model. Where can i download ONNX weights ?

Thank you for your support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions