JoePenna / Dreambooth-Stable-Diffusion

Implementation of Dreambooth (https://arxiv.org/abs/2208.12242) by way of Textual Inversion (https://arxiv.org/abs/2208.01618) for Stable Diffusion (https://arxiv.org/abs/2112.10752). Tweaks focused on training faces, objects, and styles.
MIT License
3.2k stars 557 forks source link

Error while saving pretrained model #155

Closed ghost closed 11 months ago

ghost commented 1 year ago

TypeError Traceback (most recent call last) in 1 import accelerate ----> 2 accelerate.notebook_launcher(training_function, args=(text_encoder, vae, unet))

2 frames /usr/local/lib/python3.8/dist-packages/accelerate/launchers.py in notebook_launcher(function, args, num_processes, mixed_precision, use_port) 101 else: 102 print("Launching training on one CPU.") --> 103 function(*args) 104 else: 105 if num_processes is None:

in training_function(text_encoder, vae, unet) 123 feature_extractor=CLIPFeatureExtractor.from_pretrained("openai/clip-vit-base-patch32"), 124 ) --> 125 pipeline.save_pretrained(output_dir) 126 # Also save the newly trained embeddings 127 learned_embeds = accelerator.unwrap_model(text_encoder).get_input_embeddings().weight[placeholder_token_id]

/usr/local/lib/python3.8/dist-packages/diffusers/pipeline_utils.py in save_pretrained(self, save_directory) 155 break 156 --> 157 save_method = getattr(sub_model, save_method_name) 158 save_method(os.path.join(save_directory, pipeline_component_name)) 159

TypeError: getattr(): attribute name must be string