XL Lora Trainer: TypeError: CLIPTextModel.__init__() got an unexpected keyword argument 'offload_state_dict' · Issue #2 · uYouUs/kohya-colab · GitHub
Skip to content

XL Lora Trainer: TypeError: CLIPTextModel.__init__() got an unexpected keyword argument 'offload_state_dict' #2

Closed

Description

@Betamarrajr

As the title says , before the trains actually starts it stops at:

Traceback (most recent call last): File "/content/kohya-trainer/train_network_xl_[wrapper.py](http://wrapper.py/)", line 10, in <module> trainer.train(args) File "/content/kohya-trainer/train_[network.py](http://network.py/)", line 234, in train model_version, text_encoder, vae, unet = self.load_target_model(args, weight_dtype, accelerator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/content/kohya-trainer/sdxl_train_[network.py](http://network.py/)", line 43, in load_target_model ) = sdxl_train_util.load_target_model(args, accelerator, sdxl_model_util.MODEL_VERSION_SDXL_BASE_V1_0, weight_dtype) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/content/kohya-trainer/library/sdxl_train_[util.py](http://util.py/)", line 43, in load_target_model ) = loadtarget_model( ^^^^^^^^^^^^^^^^^^^ File "/content/kohya-trainer/library/sdxl_train_[util.py](http://util.py/)", line 91, in loadtarget_model pipe = StableDiffusionXLPipeline.from_pretrained( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_[validators.py](http://validators.py/)", line 114, in innerfn return fn(*args, kwargs) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/pipeline_[utils.py](http://utils.py/)", line 1025, in from_pretrained loaded_sub_model = load_sub_model( ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/pipeline_loading_[utils.py](http://utils.py/)", line 849, in load_sub_model loaded_sub_model = load_method(os.path.join(cached_folder, name), loading_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/transformers/modeling_[utils.py](http://utils.py/)", line 277, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/transformers/modeling[utils.py](http://utils.py/)", line 4974, in from_pretrained model = cls(config, model_args, *model_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

TypeError: CLIPTextModel.__init__() got an unexpected keyword argument 'offload_state_dict'

Activity

  1. gwhitez commented on Oct 12, 2025

    @gwhitez

    A Transformers error; using transformers==4.47.1 fixes the error.

  2. uYouUs commented on Oct 13, 2025

    @uYouUs
    Owner

    Yes, this is a known issue with transformers 4.57.0, and google colab updated to this version. It will be a while before Google Colab updates with the fix. So I pushed a temporary patch to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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