bmaltais / kohya_ss

Apache License 2.0
9.7k stars 1.25k forks source link

Google Colab Notebook: ImportError: cannot import name 'split_torch_state_dict_into_shards' from 'huggingface_hub' (/usr/local/lib/python3.10/dist-packages/huggingface_hub/__init__.py) #2970

Open davdotsol opened 4 days ago

davdotsol commented 4 days ago

I'm trying to train the data: accelerate launch --num_cpu_threads_per_process=2 "./sdxl_train_network.py" --pretrained_model_name_or_path="/content/civitai/realismEngineSDXL_v20VAE. safetensors"
--train_data_dir="/content/kohya_ss/stable-diffusion-webui/models/Lora/sks2 0/img"
--reg_data_dir="/content/kohya_ss/stable-diffusion-webui/models/Lora/sks20/ reg" --resolution="1024,1024"
--output_dir="/content/kohya_ss/stable-diffusion-webui/models/Lora/sks20/mo del"
--logging_dir="/content/kohya_ss/stable-diffusion-webui/models/Lora/sks20/l og" --network_alpha="1" --save_model_as=safetensors
--network_module=lycoris.kohya --network_args "conv_dim=32" "conv_alpha=1" "algo=lora" --text_encoder_lr=0.0004 --unet_lr=0.0004 --network_dim=32
--gradient_accumulation_steps=2 --output_name="sks26_1001_lycoris_2"
--lr_scheduler_num_cycles="10" --network_dropout="0.1" --no_half_vae
--learning_rate="0.0004" --lr_scheduler="constant" --train_batch_size="1"
--max_train_steps="14600" --mixed_precision="fp16" --save_precision="fp16" --cache_latents --cache_latents_to_disk --optimizer_type="Adafactor"
--optimizer_args scale_parameter=False relative_step=False
warmup_init=False --max_data_loader_n_workers="0" --bucket_reso_steps=64
--save_every_n_steps="1000" --flip_aug --gradient_checkpointing --full_fp16 --xformers --bucket_no_upscale
Traceback (most recent call last): File "/usr/local/bin/accelerate", line 5, in from accelerate.commands.accelerate_cli import main File "/usr/local/lib/python3.10/dist-packages/accelerate/init.py", line 16, in from .accelerator import Accelerator File "/usr/local/lib/python3.10/dist-packages/accelerate/accelerator.py", line 34, in from huggingface_hub import split_torch_state_dict_into_shards ImportError: cannot import name 'split_torch_state_dict_into_shards' from 'huggingface_hub' (/usr/local/lib/python3.10/dist-packages/huggingface_hub/init.py)

kemilall commented 3 days ago

Same problem here