Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache_text_encoder_outputs.py raises AttributeError: 'Namespace' object has no attribute 'deepspeed' #1288

Open
deepdelirious opened this issue Apr 22, 2024 · 3 comments

Comments

@deepdelirious
Copy link

deepdelirious commented Apr 22, 2024

Seeing this on the main branch:

Traceback (most recent call last):
  File "/home/deli/images/sd-scripts/tools/cache_text_encoder_outputs.py", line 194, in <module>
    cache_to_disk(args)
  File "/home/deli/images/sd-scripts/tools/cache_text_encoder_outputs.py", line 102, in cache_to_disk
    accelerator = train_util.prepare_accelerator(args)
  File "/home/deli/images/sd-scripts/library/train_util.py", line 4303, in prepare_accelerator
    deepspeed_plugin = deepspeed_utils.prepare_deepspeed_plugin(args)
  File "/home/deli/images/sd-scripts/library/deepspeed_utils.py", line 71, in prepare_deepspeed_plugin
    if not args.deepspeed:
AttributeError: 'Namespace' object has no attribute 'deepspeed'
@deepdelirious
Copy link
Author

FYI @BootsofLagrangian

@BootsofLagrangian
Copy link
Contributor

It is because cache_text_encoder_outputs.py does not prepare deepspeed config not like train_.py

you can add ad-hoc for this

  1. from library import deepspeed_utils

  2. in line between 174-178,

      train_util.add_sd_models_arguments(parser)
      train_util.add_training_arguments(parser, True)
      train_util.add_dataset_arguments(parser, True, True, True)
      config_util.add_config_arguments(parser)
      sdxl_train_util.add_sdxl_training_arguments(parser)

to

      train_util.add_sd_models_arguments(parser)
      train_util.add_training_arguments(parser, True)
      train_util.add_dataset_arguments(parser, True, True, True)
+    deepspeed_utils.prepare_deepspeed_args(args)
      config_util.add_config_arguments(parser)
      sdxl_train_util.add_sdxl_training_arguments(parser)

67372a added a commit to 67372a/sd-scripts that referenced this issue May 18, 2024
@noisefloordev
Copy link

Same problem in cache_latents.py. (I thought this "Deepspeed" stuff was going to be in a separate branch since it was hard to maintain...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants