Skip to content

Bugs in the pretrain script #23

@shenzy08

Description

@shenzy08

I ran the pretraining script

CUDA_VISIBLE_DEVICES=1 accelerate launch pretrain_e4t.py --pretrained_model_name_or_path="CompVis/stable-diffusion-v1-4" --clip_model_name_or_path="ViT-H-14::laion2b_s32b_b79k" --domain_class_token="cat" --placeholder_token="*s" --prompt_template=normal --save_sample_prompt="a photo of the *s, a photo of the *s in monet style" --reg_lambda=0.01 --domain_embed_scale=0.1 --output_dir="pretrained-cat" --train_image_dataset="/dataset/e4t/dataset/cat/" --iterable_dataset --resolution=512 --train_batch_size=16 --learning_rate=1e-6 --scale_lr --checkpointing_steps=10000 --log_steps=1000 --max_train_steps=100000 --unfreeze_clip_vision --mixed_precision="fp16" --enable_xformers_memory_efficient_attention

and encountered the error
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

This bug is from the line 99 of "e4t-diffusion/e4t/utils.py", where ckpt is None for os.path.exists(ckpt_path).
When checking the related code, I notice that in line 238 and 249 of pretrain_u4t.py, the ckpt_path is specially set to a weight_offsets.pt and encoder.pt. However, there are no such files before pretraining in a base model like "CompVis/stable-diffusion-v1-4", so it seems rather weird. Please help me fix this issue, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions