bmaltais/kohya_ss

Kohya_ss GUI cannot be started in Windows

pro-krastinator opened this issue ยท 9 comments

After successful fresh install with the following parameters:

Kohya_ss GUI setup menu:

1. Install kohya_ss gui
2. (Optional) Install cudann files (avoid unless you really need it)
3. (Optional) Install specific bitsandbytes versions
4. (Optional) Manually configure accelerate
5. (Optional) Start Kohya_ss GUI in browser
6. Quit

Enter your choice: 1

1. Torch 1 (legacy, no longer supported. Will be removed in v21.9.x)
2. Torch 2 (recommended)
3. Cancel

Enter your choice: 2

I cannot start Kohya_ss GUI in browser with the following error:

14:47:59-997478 INFO     Version: v21.8.6

14:48:00-001482 INFO     nVidia toolkit detected
14:48:02-464841 INFO     Torch 2.0.1+cu118
14:48:02-481141 INFO     Torch backend: nVidia CUDA 11.8 cuDNN 8700
14:48:02-483143 INFO     Torch detected GPU: NVIDIA GeForce RTX 4090 VRAM 24564 Arch (8, 9) Cores 128
14:48:02-484144 INFO     Verifying modules instalation status from requirements_windows_torch2.txt...
14:48:02-485144 INFO     Verifying modules instalation status from requirements.txt...
Traceback (most recent call last):
  File "portable\kohya_gui.py", line 1, in <module>
    import gradio as gr
  File "portable\venv\lib\site-packages\gradio\__init__.py", line 3, in <module>
    import gradio.components as components
  File "portable\venv\lib\site-packages\gradio\components\__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "portable\venv\lib\site-packages\gradio\components\annotated_image.py", line 13, in <module>
    from gradio.components.base import IOComponent, _Keywords
  File "portable\venv\lib\site-packages\gradio\components\base.py", line 29, in <module>
    from gradio.blocks import Block, BlockContext
  File "portable\venv\lib\site-packages\gradio\blocks.py", line 26, in <module>
    from gradio import (
  File "portable\venv\lib\site-packages\gradio\networking.py", line 18, in <module>
    from gradio.routes import App
  File "portable\venv\lib\site-packages\gradio\routes.py", line 44, in <module>
    import gradio.ranged_response as ranged_response
  File "portable\venv\lib\site-packages\gradio\ranged_response.py", line 12, in <module>
    from aiofiles.os import stat as aio_stat
  File "portable\venv\lib\site-packages\aiofiles\os.py", line 32, in <module>
    statvfs = wrap(os.statvfs)
AttributeError: module 'os' has no attribute 'statvfs'

P.S. Also there is a typo: instalation instead of installation

For now as a temporary workaround, I commented out the line that references statvfs in the aiofiles package in the mentioned path (venv\lib\site-packages\aiofiles\os.py) and comment out the line statvfs = wrap(os.statvfs). However, this is probably a hacky solution and might lead to other unforeseen issues. Please note that I am not a programmer at all. ๐Ÿ˜Š

Same issue here

windows server 2019 . same issue here

Same here as well.

same

Temperary workaround here #1358 (comment)

This is a bug from aiofiles. To fix this, only need to activate the vene and execute "pip install --upgrade aiofiles" to upgrade the aiofiles.

Thank you both, @buzzz3d and @YuanGYao , this workaround worked.
But the issue with current state of kohya_ss sdxl branch which would not allow to start GUI after fresh installation, out-of-the-box, so to speak, still exist.

Hummm... this module is frustratingly causing the issue. I will try to pin the new version so it will at least stay there and install if an older one is used...