ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[BUG]: Wrong in finetune stable diffusion 2.0

Open FrankieDong opened this issue 2 years ago • 3 comments

🐛 Describe the bug

I wanted to finetune stable diffusion 2.0 model, as the step, I install the colossalai up to 0.1.12, and install the lightning from the code source, version 1.8.6, but it is wrong, "type object 'ChunkManager' has no attribute 'search_chunk_size'"

And can i finetune SD 2.0 model now ?

Environment

torch: 1.11 cuda: 10.2 python 3.8

FrankieDong avatar Dec 28 '22 09:12 FrankieDong

Thanks for your issue, our version of ColossalAi have some conflict with pytorch-lightning,We are working on incorporating our latest PR into pytorch- lightning as soon as we can. if you want to avoid environment problem, I suggest you to use our docker

Fazziekey avatar Jan 03 '23 08:01 Fazziekey

image

Fazziekey avatar Jan 03 '23 08:01 Fazziekey

I tried the docker image, but bunch of requirements were not installed, like pytorch-lightning, bitsandbytes. After installing the requirements, there are still problems, stop trying.

Enviroment:

  • image: hpcaitech/colossalai:0.2.0
  • script: /workspace/ColossalAI/examples/tutorial/stable_diffusion/script/txt2img.py
  • model: local ckpt of stable diffusion v2

To produce:

python scripts/txt2img.py --prompt 'cute cat' --plms --outdir out --config stable-diffusion-2-base/model_index.json --ckpt stable-diffusion-2-base/512-base-ema.ckpt

Logs:

Global seed set to 42
Loading model from /home/hrh/stable-diffusion-2-base/512-base-ema.ckpt
Global Step: 875000
Traceback (most recent call last):
  File "/workspace/ColossalAI/examples/tutorial/stable_diffusion/scripts/txt2img.py", line 344, in <module>
    main()
  File "/workspace/ColossalAI/examples/tutorial/stable_diffusion/scripts/txt2img.py", line 240, in main
    model = load_model_from_config(config, f"{opt.ckpt}")
  File "/workspace/ColossalAI/examples/tutorial/stable_diffusion/scripts/txt2img.py", line 54, in load_model_from_config
    model = instantiate_from_config(config.model)
  File "/opt/conda/lib/python3.9/site-packages/omegaconf/dictconfig.py", line 353, in __getattr__
    self._format_and_raise(
  File "/opt/conda/lib/python3.9/site-packages/omegaconf/base.py", line 190, in _format_and_raise
    format_and_raise(
  File "/opt/conda/lib/python3.9/site-packages/omegaconf/_utils.py", line 821, in format_and_raise
    _raise(ex, cause)
  File "/opt/conda/lib/python3.9/site-packages/omegaconf/_utils.py", line 719, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set end OC_CAUSE=1 for full backtrace
  File "/opt/conda/lib/python3.9/site-packages/omegaconf/dictconfig.py", line 351, in __getattr__
    return self._get_impl(key=key, default_value=_DEFAULT_MARKER_)
  File "/opt/conda/lib/python3.9/site-packages/omegaconf/dictconfig.py", line 438, in _get_impl
    node = self._get_node(key=key, throw_on_missing_key=True)
  File "/opt/conda/lib/python3.9/site-packages/omegaconf/dictconfig.py", line 470, in _get_node
    raise ConfigKeyError(f"Missing key {key}")
omegaconf.errors.ConfigAttributeError: Missing key model
    full_key: model
    object_type=dict

Not sure if i am using the wrong script.

rawk-v avatar Jan 10 '23 06:01 rawk-v

We have updated a lot. This issue was closed due to inactivity. Thanks.

binmakeswell avatar Apr 14 '23 09:04 binmakeswell