Text-to-Image
Diffusers
StableDiffusionPipeline
stable-diffusion
stable-diffusion-diffusers

Run this model with HF Jobs

Run segmind/tiny-sd on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/segmind/tiny-sd. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/segmind/tiny-sd on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Unable to save the unet weights after finetuning the model using text_to_image.py (ValueError: You are trying to save a non contiguous tensor: `conv_in.weight` which is not allowed))

#4
by Palawat - opened

I want to finetune tiny-sd on a different dataset by following text_to_image training (https://huggingface.co/docs/diffusers/main/en/training/text2image) and change the model_name to "segmind/tiny-sd". However, once I run the following code, I get this error.
export MODEL_NAME="segmind/tiny-sd"
export dataset_name="lambdalabs/pokemon-blip-captions"

accelerate launch examples/text_to_image/train_text_to_image.py
--pretrained_model_name_or_path=$MODEL_NAME
--dataset_name=$dataset_name
--use_ema
--resolution=512 --center_crop --random_flip
--train_batch_size=1
--gradient_accumulation_steps=4
--gradient_checkpointing
--mixed_precision="fp16"
--max_train_steps=20
--learning_rate=1e-05
--max_grad_norm=1
--lr_scheduler="constant" --lr_warmup_steps=0
--output_dir="sd-pokemon-model"

======================Error=====================================

image.png

Note that the small-sd version doesn't have this problem. Only the tiny-sd version has this issue.
Thank you,

same problem, Only the tiny-sd version has this issue.
segmind/small-sd don't have issue

Same. What the hell bro? :(

Here is a simple reproducible example:

from diffusers import UNet2DConditionModel


unet = UNet2DConditionModel.from_pretrained(
    "segmind/tiny-sd", subfolder="unet"
)

unet.save_pretrained("/test")

@Palawat @neurlang ChatGPT helped me to fix it:

for param in unet.parameters():
    param.data = param.data.contiguous()

Sign up or log in to comment