ImportError: cannot import name 'cached_download' from 'huggingface_hub'
Closed this issue · 3 comments
Prerequisites
- I have read the documentation.
- I have checked other issues for similar problems.
Backend
Colab
Interface Used
UI
CLI Command
No response
UI Screenshots & Parameters
No response
Error Logs
INFO | 2024-11-25 22:46:05 | autotrain.cli.run_dreambooth:run:388 - Running DreamBooth Training
WARNING | 2024-11-25 22:46:05 | autotrain.trainers.common:init:286 - Parameters supplied but not used: version, backend, inference, train_split, log, train, deploy, func, data_path, config, valid_split
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/3x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/7x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/6x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/5x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/14x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/1x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/12x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/4x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/13x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/2x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/8x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/11x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/10x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/15x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:87 - Saving concept images
INFO | 2024-11-25 22:46:05 | autotrain.preprocessor.dreambooth:_save_concept_images:88 - images/9x.jpg
INFO | 2024-11-25 22:46:05 | autotrain.backends.local:create:20 - Starting local training...
INFO | 2024-11-25 22:46:05 | autotrain.commands:launch_command:523 - ['python', '-m', 'autotrain.trainers.dreambooth', '--training_config', 'kamirox/training_params.json']
INFO | 2024-11-25 22:46:05 | autotrain.commands:launch_command:524 - {'model': 'stabilityai/stable-diffusion-xl-base-1.0', 'vae_model': None, 'revision': None, 'tokenizer': None, 'image_path': 'kamirox/autotrain-data', 'class_image_path': None, 'prompt': 'kamirox', 'class_prompt': None, 'num_class_images': 100, 'class_labels_conditioning': None, 'prior_preservation': False, 'prior_loss_weight': 1.0, 'project_name': 'kamirox', 'seed': 42, 'resolution': 1024, 'center_crop': False, 'train_text_encoder': False, 'batch_size': 1, 'sample_batch_size': 4, 'epochs': 1, 'num_steps': 500, 'checkpointing_steps': 100000, 'resume_from_checkpoint': None, 'gradient_accumulation': 4, 'disable_gradient_checkpointing': False, 'lr': 0.0001, 'scale_lr': False, 'scheduler': 'constant', 'warmup_steps': 0, 'num_cycles': 1, 'lr_power': 1.0, 'dataloader_num_workers': 0, 'use_8bit_adam': False, 'adam_beta1': 0.9, 'adam_beta2': 0.999, 'adam_weight_decay': 0.01, 'adam_epsilon': 1e-08, 'max_grad_norm': 1.0, 'allow_tf32': False, 'prior_generation_precision': None, 'local_rank': -1, 'xformers': False, 'pre_compute_text_embeddings': False, 'tokenizer_max_length': None, 'text_encoder_use_attention_mask': False, 'rank': 4, 'xl': True, 'mixed_precision': 'fp16', 'token': None, 'push_to_hub': False, 'username': '0', 'validation_prompt': None, 'num_validation_images': 4, 'validation_epochs': 50, 'checkpoints_total_limit': None, 'validation_images': None, 'logging': False}
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.10/dist-packages/autotrain/trainers/dreambooth/main.py", line 5, in
from diffusers.utils import convert_all_state_dict_to_peft, convert_state_dict_to_kohya
File "/usr/local/lib/python3.10/dist-packages/diffusers/init.py", line 5, in
from .utils import (
File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/init.py", line 38, in
from .dynamic_modules_utils import get_class_from_dynamic_module
File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/dynamic_modules_utils.py", line 28, in
from huggingface_hub import cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/usr/local/lib/python3.10/dist-packages/huggingface_hub/init.py)
INFO | 2024-11-25 22:46:09 | autotrain.cli.run_dreambooth:run:392 - Job ID: 4029
Additional Information
No response
taking a look
seems like I am getting the same error:
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.10/dist-packages/autotrain/trainers/dreambooth/__main__.py", line 5, in <module>
from diffusers.utils import convert_all_state_dict_to_peft, convert_state_dict_to_kohya
File "/usr/local/lib/python3.10/dist-packages/diffusers/__init__.py", line 5, in <module>
from .utils import (
File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/__init__.py", line 38, in <module>
from .dynamic_modules_utils import get_class_from_dynamic_module
File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/dynamic_modules_utils.py", line 28, in <module>
from huggingface_hub import cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/usr/local/lib/python3.10/dist-packages/huggingface_hub/__init__.py)
INFO | 2024-11-27 06:08:05 | autotrain.cli.run_dreambooth:run:392 - Job ID: 2551
autotrain doesnt support dreambooth anymore. to train loras please use: https://huggingface.co/spaces/autotrain-projects/train-flux-lora-ease