lora icon indicating copy to clipboard operation
lora copied to clipboard

colab issue

Open treksis opened this issue 2 years ago • 8 comments

Hi,

with the updated repo, the file path has changed. It needs an update.

!accelerate launch lora/train_lora_dreambooth.py
to
!accelerate launch lora/training_scripts/train_lora_dreambooth.py
and xformers
WARNING:accelerate.commands.launch:The following values were not passed to `accelerate launch` and had defaults used instead:
	`--num_processes` was set to a value of `1`
	`--num_machines` was set to a value of `1`
	`--mixed_precision` was set to a value of `'no'`
	`--dynamo_backend` was set to a value of `'no'`
To avoid this warning pass in values for each of the problematic parameters or run `accelerate config`.
/usr/bin/python3: can't open file 'lora/train_lora_dreambooth.py': [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/usr/local/bin/accelerate", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/accelerate_cli.py", line 45, in main
    args.func(args)
  File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 1104, in launch_command
    simple_launcher(args)
  File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 567, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', 'lora/train_lora_dreambooth.py', '--pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5', '--instance_data_dir=/content/data_example', '--output_dir=/content/output', '--instance_prompt=wandal', '--resolution=512', '--use_8bit_adam', '--mixed_precision=fp16', '--train_batch_size=1', '--gradient_accumulation_steps=1', '--learning_rate=2e-05', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--max_train_steps=100', '--train_text_encoder', '--learning_rate_text=1e-05']' returned non-zero exit status 2.
WARNING :accelerate.commands.launch:The following values were not passed to `accelerate launch` and had defaults used instead:
	`--num_processes` was set to a value of `1`
	`--num_machines` was set to a value of `1`
	`--mixed_precision` was set to a value of `'no'`
	`--dynamo_backend` was set to a value of `'no'`
To avoid this warning pass in values for each of the problematic parameters or run `accelerate config`.
Traceback (most recent call last):
  File "lora/training_scripts/train_lora_dreambooth.py", line 40, in <module>
    from lora_diffusion.xformers_utils import set_use_memory_efficient_attention_xformers
  File "/usr/local/lib/python3.8/dist-packages/lora_diffusion/xformers_utils.py", line 16, in <module>
    @functools.cache
AttributeError: module 'functools' has no attribute 'cache'
Traceback (most recent call last):
  File "/usr/local/bin/accelerate", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/accelerate_cli.py", line 45, in main
    args.func(args)
  File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 1104, in launch_command
    simple_launcher(args)
  File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 567, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', 'lora/training_scripts/train_lora_dreambooth.py', '--pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5', '--instance_data_dir=/content/data_example', '--output_dir=/content/output', '--instance_prompt=wandal', '--resolution=512', '--use_8bit_adam', '--mixed_precision=fp16', '--train_batch_size=1', '--gradient_accumulation_steps=1', '--learning_rate=2e-05', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--max_train_steps=100', '--train_text_encoder', '--learning_rate_text=1e-05']' returned non-zero exit status 1.

treksis avatar Jan 09 '23 16:01 treksis

Ah, indeed. Maybe @pedrogengo can help us here

cloneofsimo avatar Jan 10 '23 14:01 cloneofsimo

Sure thing! Looking to it

pedrogengo avatar Jan 10 '23 16:01 pedrogengo

Fixed!

pedrogengo avatar Jan 10 '23 17:01 pedrogengo

how to fix the problem "AttributeError: module 'functools' has no attribute 'cache'"

eudoraxj avatar Feb 09 '23 04:02 eudoraxj

sounds python 3.10 version solved the problem

zxOnVacation avatar Feb 15 '23 04:02 zxOnVacation

I just got this same error. I don't understand how it's fixed

Indigo-Bunting avatar Mar 01 '23 01:03 Indigo-Bunting

I will take a look into it tomorrow and let you know!

pedrogengo avatar Mar 01 '23 03:03 pedrogengo

hi is there any solution for 'AttributeError: module 'functools' has no attribute 'cache'' ?

JamesSand avatar Apr 10 '23 16:04 JamesSand