Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: "--replace_underscores" now an unrecognized argument for wd14 tagging #439

Closed
DocShotgun opened this issue Mar 23, 2023 · 4 comments

Comments

@DocShotgun
Copy link

After commit 838478b with the big code refactoring, the replace underscores feature for wd14 tagging appears to be broken. Upon attempting to tag with that box checked, this error appears:

usage: tag_images_by_wd14_tagger.py [-h] [--repo_id REPO_ID] [--model_dir MODEL_DIR] [--force_download]
                                    [--thresh THRESH] [--batch_size BATCH_SIZE]
                                    [--max_data_loader_n_workers MAX_DATA_LOADER_N_WORKERS]
                                    [--caption_extention CAPTION_EXTENTION] [--caption_extension CAPTION_EXTENSION]
                                    [--debug]
                                    train_data_dir
tag_images_by_wd14_tagger.py: error: unrecognized arguments: --replace_underscores
Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Me\Documents\kohya_ss\venv\Scripts\accelerate.exe\__main__.py", line 7, in <module>
  File "C:\Users\Me\Documents\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main
    args.func(args)
  File "C:\Users\Me\Documents\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command
    simple_launcher(args)
  File "C:\Users\Me\Documents\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 567, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\Me\\Documents\\kohya_ss\\venv\\Scripts\\python.exe', './finetune/tag_images_by_wd14_tagger.py', '--batch_size=1', '--thresh=0.35', '--replace_underscores', '--caption_extension=.txt', 'C:/Users/Me/Pictures/Training/Datasets/Experimental/ds2']' returned non-zero exit status 2.

Wd14 tagging appears to work correctly when this option is not selected. Right now we can work around it by using caption S/R now that it has been fixed on the latest commit.

@bmaltais
Copy link
Owner

The reason is that this change need to be integrated in kohya_ss repo. The PR changed the code from kohya... but with every update he will keep undoing it everytime until it is integrated in his code. I suggest to make a PR directly with him to implement this: https://github.com/kohya-ss/sd-scripts/pulls

@bmaltais
Copy link
Owner

I am implementing a work around where you won't need to open a PR... will push to dev soon

@bmaltais
Copy link
Owner

OK, checkout the dev branch for the fix

@bmaltais bmaltais mentioned this issue Mar 24, 2023
@DocShotgun
Copy link
Author

Cool, resolved by the newest version, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants