kohya_ss icon indicating copy to clipboard operation
kohya_ss copied to clipboard

Accelerate config step during installation won't work

Open HanJammer opened this issue 2 years ago • 1 comments

Basically when I try to run accelerate config it will throw a bunch of errors:

(venv) PS G:!AI\SD\kohya_ss> accelerate config ------------------------------------------------------------------------------------------------------------------------In which compute environment are you running? Please select a choice using the arrow or number keys, and selecting with enter Traceback (most recent call last): File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Python310\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "G:!AI\SD\kohya_ss\venv\Scripts\accelerate.exe_main.py", line 7, in File "G:!AI\SD\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main args.func(args) File "G:!AI\SD\kohya_ss\venv\lib\site-packages\accelerate\commands\config\config.py", line 67, in config_command config = get_user_input() File "G:!AI\SD\kohya_ss\venv\lib\site-packages\accelerate\commands\config\config.py", line 32, in get_user_input compute_environment = _ask_options( File "G:!AI\SD\kohya_ss\venv\lib\site-packages\accelerate\commands\config\config_utils.py", line 58, in _ask_options result = menu.run(default_choice=default) File "G:!AI\SD\kohya_ss\venv\lib\site-packages\accelerate\commands\menu\selection_menu.py", line 118, in run choice = self.handle_input() File "G:!AI\SD\kohya_ss\venv\lib\site-packages\accelerate\commands\menu\input.py", line 73, in handle_input char = get_character() File "G:!AI\SD\kohya_ss\venv\lib\site-packages\accelerate\commands\menu\keymap.py", line 114, in get_character char = get_raw_chars() File "G:!AI\SD\kohya_ss\venv\lib\site-packages\accelerate\commands\menu\keymap.py", line 77, in get_raw_chars if ch.encode(encoding) in (b"\x00", b"\xe0"): UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character

I'm running Polish version of Windows and 852 (OEM - Latin II) codepage for the cmd / powershell - but I tried to switch to Unicode few days ago and it was failing the same way.

Edit: it's pretty much impossible to select options using arrows (will throw the error immediately) and the number keys won't work correctly too. For now I left the default options which should work.

HanJammer avatar Jan 25 '23 01:01 HanJammer

Please delete the venv and reso the install using the latest instructions... particularly important is this updated step:

python -m venv venv

This should ensure that local packages will not conflict with kohya GUI.

bmaltais avatar Jan 27 '23 12:01 bmaltais

This issue is still present and has nothing to do with venv - I would rather suspect keyboard layout setting or maybe OS codepage... for now using the numbers on the keyboard work but trying to use cursor keys immediately breaks the installation.

HanJammer avatar Mar 20 '23 20:03 HanJammer