XavierXiao / Dreambooth-Stable-Diffusion

Implementation of Dreambooth (https://arxiv.org/abs/2208.12242) with Stable Diffusion
MIT License
7.6k stars 795 forks source link

TypeError: __init__() missing 1 required positional argument: 'personalization_config' #162

Closed FanSZheng closed 6 months ago

FanSZheng commented 7 months ago

when I ran the latent_imagenet_diffusion.ipynb, I encountered a problem:

TypeError                                 Traceback (most recent call last)
Cell In[13], line 3
      1 from ldm.models.diffusion.ddim import DDIMSampler
----> 3 model = get_model()
      4 sampler = DDIMSampler(model)

Cell In[12], line 21, in get_model()
     19 def get_model():
     20     config = OmegaConf.load("configs/latent-diffusion/cin256-v2.yaml")  
---> 21     model = load_model_from_config(config, "models/ldm/cin256-v2/model.ckpt")
     22     return model

Cell In[12], line 12, in load_model_from_config(config, ckpt)
     10 pl_sd = torch.load(ckpt)#, map_location="cpu")
     11 sd = pl_sd["state_dict"]
---> 12 model = instantiate_from_config(config.model)
     13 m, u = model.load_state_dict(sd, strict=False)
     14 model.cuda()

File ~.../project/Dreambooth-Stable-Diffusion/ldm/util.py:85, in instantiate_from_config(config, **kwargs)
     83         return None
     84     raise KeyError("Expected key `target` to instantiate.")
---> 85 return get_obj_from_str(config["target"])(**config.get("params", dict()), **kwargs)

TypeError: __init__() missing 1 required positional argument: 'personalization_config'

How can I do for it?

FanSZheng commented 7 months ago

I try to use the code like:

pip install -e .

and the TypeError is solved.

but there is another problem:

RuntimeError: unexpected EOF, expected 255724 more bytes. The file might be corrupted.

I try to download many times, but it's still wrong.

FanSZheng commented 6 months ago

Oh,I found where the problem occurred.

My CUDA version is too low, when I switched to CUDA 12.0, the problem was resolved.