d8ahazard / sd_dreambooth_extension

Other
1.85k stars 280 forks source link

Exception training model: 'Repo id must use alphanumeric chars #803

Closed Flonixcorn closed 1 year ago

Flonixcorn commented 1 year ago
Python revision: 3.10.7 (tags/v3.10.7:6cc6b13, Sep  5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
Dreambooth revision: c2269b8585d994efa31c6582fc19a890253c804e
SD-WebUI revision: b165e341e70300f66c8a77b9383041f4147b24a8

Checking Dreambooth requirements...
[+] bitsandbytes version 0.35.0 installed.
[+] diffusers version 0.10.2 installed.
[+] transformers version 4.25.1 installed.
[+] xformers version 0.0.14.dev0 installed.
[+] torch version 1.12.1+cu113 installed.
[+] torchvision version 0.13.1+cu113 installed.

Have you read the Readme? Yes Have you completely restarted the stable-diffusion-webUI, not just reloaded the UI? Yes Have you updated Dreambooth to the latest revision? Yes Have you updated the Stable-Diffusion-WebUI to the latest version? Yes No, really. Please save us both some trouble and update the SD-WebUI and Extension and restart before posting this. Reply 'OK' Below to acknowledge that you did this. OK Describe the bug

(A clear and concise description of what the bug is) When Training a model that i created i just throws this error: Training completed, reloading SD Model. Restored system models. Returning result: Exception training model: 'Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: 'X:\AI\StableDiffusion\stable-diffusion-webui\models\dreambooth\ApterusArt\working\tokenizer'.'.

Provide logs

Logs at the bottom

Environment

native windows, rtx 3090 image


Already up to date.
venv "X:\AI\StableDiffusion\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep  5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
Commit hash: b165e341e70300f66c8a77b9383041f4147b24a8
Installing requirements for Web UI
Installing requirements for scikit_learn

#######################################################################################################
Initializing Dreambooth
If submitting an issue on github, please provide the below text for debugging purposes:

Python revision: 3.10.7 (tags/v3.10.7:6cc6b13, Sep  5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
Dreambooth revision: c2269b8585d994efa31c6582fc19a890253c804e
SD-WebUI revision: b165e341e70300f66c8a77b9383041f4147b24a8

Checking Dreambooth requirements...
[+] bitsandbytes version 0.35.0 installed.
[+] diffusers version 0.10.2 installed.
[+] transformers version 4.25.1 installed.
[+] xformers version 0.0.14.dev0 installed.
[+] torch version 1.12.1+cu113 installed.
[+] torchvision version 0.13.1+cu113 installed.

#######################################################################################################

Installing imageio-ffmpeg requirement for depthmap script
Installing pyqt5 requirement for depthmap script

Launching Web UI with arguments: --xformers --precision full --no-half
X:\AI\StableDiffusion\stable-diffusion-webui\venv\Scripts\python.exe
WARNING:dynamicprompts.generators.attentiongenerator:Spacy not installed, attention generator will not work. Install with pip install dynamicprompts[attentiongrabber]
SD-Webui API layer loaded
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading weights [0aecbcfa2c] from X:\AI\StableDiffusion\stable-diffusion-webui\models\Stable-diffusion\!Styles\dreamlikeart\dreamlike-diffusion-1.0.ckpt
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(26): AIsideview, bad_prompt_version2, Blueprintv1, dm-s1, evreka15, Flonixnegs, Flonixnegs2, Flonixnegs3, Flonixprompt1, Flonixprompt2, Flonixprompt3, sad_atmospheric, samdoesart, samdoesarts, sideviewv2, sideviewv4-200, sideviewv4, Style-Autumn512, Style-Glorious512, Style-Princess, Style-Psycho512, Style-Winter512, TestBed-155, TestBed-55, TestBed, TestZeroStyle
Textual inversion embeddings skipped(121): AnalogEmbeddingV1, AnalogEmbeddingV2, AnalogEmbeddingV3, AnalogEmbeddingV4, AnalogEmbeddingV5, AnalogEmbeddingV6, ANimeFiredragonGIrl, ANimeFiredragonGIrlv2, AnimeScreenCap768, AnimeScreenCap-90, anthro, Apoc768, Art by Smoose-22, BarbAI768, CandyPunk-90, CarHelper, carstest, carstestv2, carstestv3, castest, CGI_AnimationV2-185, CGI_AnimationV2-245, ChemPunk-96, Cinema768-Digital, cspv1, CutAway-420, CutAway-460, CutAway-500, DaveSpaceOne, dblx, dtekv1, dtekv2, dtekv3, FFbF_aTon, FFbF_effect, FFbF_Heavy, FFbF_light, FFbF_neon, FFbF_power, flonixsdviewalternative, flonixsdviewv1, flonixsdviewv2, flonixsdviewv3, flonixsdviewv4, flonixsdviewv4test, FloralMarble, HeartArt, highoctane_car-2000, HorrorByDave, HyperFluid-300, HyperFluid, HyperNuke, InkPunk768, InkPunk768_2, InkPunkHeavy768, InkPunkHeavy768_2, InkPunkLandscapes768, InkPunkLandscapes768_2, InkPunkLite768, InkPunkLite768_2, JenniferLawrence, JenniferLawrencev2, Kipaki-100, Kipaki-125, Kipaki-150, knollingcase768, MagicLightv1, midjourney, midjourney768, mjart, MJPapercut768, neg_Beauty768v4, neg_Clean768v2, Neg_Facelift768, NeonStylev1, NeonStylev3, NeonStylev4, NeonStylev5, PhotoHelper, PhotoHelper768, RainAndMonsters768, RenderStyle768, samdoesart768, samdoesart768v2, samdoesart768v3, samdoesart768v4, samdoesart768v5, samdoesart768v6, SamDoesArts768, samdoesarts768bad, SamDoesArtv7, ScaryMonstersV2, SCG768-Bliss, SCG768-Envy, SCG768-Euphoria, SCG768-Fascination, SCG768-Illustrate, SCG768-MystiqueV2, SCG768-Mystiquev3, SCG768-Nebula, SCG768-NebulaV2, SCG768-Nebulav3, SCG768-Wonder, SCG768, SCG768v4-100, SCG768v4-200, SCG768v4-Portrait-beta, sideviewv3, starwarstest, Style-Winter, testmixembed, ThisHonor, venomv1, VikingPunk, vray-render, wcat8-v1-1000, wcat8-v1-2000, Zootopia, Zootopiav2, Zootopiav3, Zootopiav4
Model loaded in 3.4s (0.4s create model, 1.2s load weights).
[tag-editor] Settings has been read from config.json
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Saved settings.
Custom model name is
Starting Dreambooth training...
Initializing dreambooth training...
Replace CrossAttention.forward to use xformers
Instance Bucket 0: Resolution (512, 512), Count: 102
Target Bucket 0: Resolution (512, 512), Count: 0
We need a total of 0 images.
Nothing to generate.
Traceback (most recent call last):
  File "X:\AI\StableDiffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\scripts\dreambooth.py", line 561, in start_training
    result = main(config, use_txt2img=use_txt2img)
  File "X:\AI\StableDiffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 973, in main
    return inner_loop()
  File "X:\AI\StableDiffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\memory.py", line 116, in decorator
    return function(batch_size, grad_size, prof, *args, **kwargs)
  File "X:\AI\StableDiffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 246, in inner_loop
    tokenizer = AutoTokenizer.from_pretrained(
  File "X:\AI\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 582, in from_pretrained
    tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
  File "X:\AI\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 433, in get_tokenizer_config
    resolved_config_file = cached_file(
  File "X:\AI\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\utils\hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
  File "X:\AI\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    validate_repo_id(arg_value)
  File "X:\AI\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 172, in validate_repo_id
    raise HFValidationError(
huggingface_hub.utils._validators.HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: 'X:\AI\StableDiffusion\stable-diffusion-webui\models\dreambooth\ApterusArt\working\tokenizer'.
Training completed, reloading SD Model.
Restored system models.
Returning result: Exception training model: 'Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: 'X:\AI\StableDiffusion\stable-diffusion-webui\models\dreambooth\ApterusArt\working\tokenizer'.'.```
Flonixcorn commented 1 year ago

This is the error when creating a model! ` Exception setting up output: Error(s) in loading state_dict for UNet2DConditionModel: Missing key(s) in state_dict: "up_blocks.0.upsamplers.0.conv.weight", "up_blocks.0.upsamplers.0.conv.bias", "up_blocks.1.upsamplers.0.conv.weight", "up_blocks.1.upsamplers.0.conv.bias", "up_blocks.2.upsamplers.0.conv.weight", "up_blocks.2.upsamplers.0.conv.bias". Unexpected key(s) in state_dict: "up_blocks.0.attentions.2.conv.bias", "up_blocks.0.attentions.2.conv.weight". Traceback (most recent call last): File "X:\AI\StableDiffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\sd_to_diff.py", line 922, in extract_checkpoint unet.load_state_dict(converted_unet_checkpoint) File "X:\AI\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1604, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for UNet2DConditionModel: Missing key(s) in state_dict: "up_blocks.0.upsamplers.0.conv.weight", "up_blocks.0.upsamplers.0.conv.bias", "up_blocks.1.upsamplers.0.conv.weight", "up_blocks.1.upsamplers.0.conv.bias", "up_blocks.2.upsamplers.0.conv.weight", "up_blocks.2.upsamplers.0.conv.bias". Unexpected key(s) in state_dict: "up_blocks.0.attentions.2.conv.bias", "up_blocks.0.attentions.2.conv.weight". Pipeline or config is not set, unable to continue.`

Flonixcorn commented 1 year ago

This error also gets thrown ` Saved settings. Custom model name is Starting Dreambooth training... Initializing dreambooth training... Replace CrossAttention.forward to use default Change in precision detected, please restart the webUI entirely to use new precision. We have 0 sample image(s). Traceback (most recent call last): File "X:\AI\StableDiffusion\stable-diffusion-webui\extensions\sd_dreambooth_extension\scripts\dreambooth.py", line 571, in start_training latest_file = max(list_of_files, key=os.path.getmtime) ValueError: max() arg is an empty sequence Training completed, reloading SD Model. Restored system models. Returning result: Exception training model: 'max() arg is an empty sequence'. `

Flonixcorn commented 1 year ago

794 fixed This!

Flonixcorn commented 1 year ago

Now getting only Returning result: Exception training model: 'max() arg is an empty sequence'.

Flonixcorn commented 1 year ago

So weird! Now it just works!