bmaltais / kohya_ss

Apache License 2.0
9.53k stars 1.23k forks source link

Error avoidance suggestion for the install portion of the tutorial. #320

Closed Nemiander closed 1 year ago

Nemiander commented 1 year ago

I had an error when trying to install for a while until i figured out it was using the latest version of python in my system(3.11). So i used py -3.10 -m venv venv I suggest altering the code in the tutorial to this.

bmaltais commented 1 year ago

I tried to run the command but I get:

PS D:\kohya_ss> python -3.10 -m venv venv
Unknown option: -3
usage: C:\Users\berna\AppData\Local\Programs\Python\Python310\python.exe [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

Is this on Linux or windows?

Nemiander commented 1 year ago

This is what i get when i use the unaltered code

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS D:\Programs\AI-stuff\SuperSD\kohya> git clone https://github.com/bmaltais/kohya_ss.git
>> cd kohya_ss
>>
>> python -m venv venv
>> .\venv\Scripts\activate
>>
>> pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
>> pip install --use-pep517 --upgrade -r requirements.txt
>> pip install -U -I --no-deps https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/f/xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl
>>
>> cp .\bitsandbytes_windows\*.dll .\venv\Lib\site-packages\bitsandbytes\
>> cp .\bitsandbytes_windows\cextension.py .\venv\Lib\site-packages\bitsandbytes\cextension.py
>> cp .\bitsandbytes_windows\main.py .\venv\Lib\site-packages\bitsandbytes\cuda_setup\main.py
>>
>> accelerate config
Cloning into 'kohya_ss'...
remote: Enumerating objects: 1621, done.
remote: Counting objects: 100% (502/502), done.
remote: Compressing objects: 100% (218/218), done.
remote: Total 1621 (delta 339), reused 421 (delta 279), pack-reused 1119
Receiving objects: 100% (1621/1621), 3.06 MiB | 7.67 MiB/s, done.
Resolving deltas: 100% (1033/1033), done.
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
.\venv\Scripts\activate : The term '.\venv\Scripts\activate' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:5 char:1
+ .\venv\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.\venv\Scripts\activate:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu116
ERROR: Could not find a version that satisfies the requirement torch==1.12.1+cu116 (from versions: none)
ERROR: No matching distribution found for torch==1.12.1+cu116
Processing d:\programs\ai-stuff\supersd\kohya\kohya_ss
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting accelerate==0.15.0
  Using cached accelerate-0.15.0-py3-none-any.whl (191 kB)
Collecting albumentations==1.3.0
  Using cached albumentations-1.3.0-py3-none-any.whl (123 kB)
Collecting altair==4.2.2
  Using cached altair-4.2.2-py3-none-any.whl (813 kB)
Collecting bitsandbytes==0.35.0
  Using cached bitsandbytes-0.35.0-py3-none-any.whl (62.5 MB)
Collecting dadaptation==1.5
  Using cached dadaptation-1.5.tar.gz (8.3 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting diffusers[torch]==0.10.2
  Using cached diffusers-0.10.2-py3-none-any.whl (503 kB)
Collecting easygui==0.98.3
  Using cached easygui-0.98.3-py2.py3-none-any.whl (92 kB)
Collecting einops==0.6.0
  Using cached einops-0.6.0-py3-none-any.whl (41 kB)
Collecting ftfy==6.1.1
  Using cached ftfy-6.1.1-py3-none-any.whl (53 kB)
Collecting gradio==3.19.1
  Using cached gradio-3.19.1-py3-none-any.whl (14.2 MB)
Collecting lion-pytorch==0.0.6
  Using cached lion_pytorch-0.0.6-py3-none-any.whl (4.2 kB)
Collecting opencv-python==4.7.0.68
  Using cached opencv_python-4.7.0.68-cp37-abi3-win_amd64.whl (38.2 MB)
Collecting pytorch-lightning==1.9.0
  Using cached pytorch_lightning-1.9.0-py3-none-any.whl (825 kB)
Collecting safetensors==0.2.6
  Using cached safetensors-0.2.6-cp311-cp311-win_amd64.whl (268 kB)
Collecting tensorboard==2.10.1
  Using cached tensorboard-2.10.1-py3-none-any.whl (5.9 MB)
Collecting tk==0.1.0
  Using cached tk-0.1.0-py3-none-any.whl (3.9 kB)
Collecting transformers==4.26.0
  Using cached transformers-4.26.0-py3-none-any.whl (6.3 MB)
Collecting fairscale==0.4.13
  Using cached fairscale-0.4.13.tar.gz (266 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting requests==2.28.2
  Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting timm==0.6.12
  Using cached timm-0.6.12-py3-none-any.whl (549 kB)
Collecting huggingface-hub==0.12.0
  Using cached huggingface_hub-0.12.0-py3-none-any.whl (190 kB)
ERROR: Could not find a version that satisfies the requirement tensorflow==2.10.1 (from versions: 2.12.0rc0)
ERROR: No matching distribution found for tensorflow==2.10.1
ERROR: xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.
cp : Could not find a part of the path
'D:\Programs\AI-stuff\SuperSD\kohya\kohya_ss\venv\Lib\site-packages\bitsandbytes\'.
At line:11 char:1
+ cp .\bitsandbytes_windows\*.dll .\venv\Lib\site-packages\bitsandbytes ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Copy-Item], DirectoryNotFoundException
    + FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.PowerShell.Commands.CopyItemCommand

cp : Could not find a part of the path
'D:\Programs\AI-stuff\SuperSD\kohya\kohya_ss\venv\Lib\site-packages\bitsandbytes\cextension.py'.
At line:12 char:1
+ cp .\bitsandbytes_windows\cextension.py .\venv\Lib\site-packages\bits ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Copy-Item], DirectoryNotFoundException
    + FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.PowerShell.Commands.CopyItemCommand

cp : Could not find a part of the path
'D:\Programs\AI-stuff\SuperSD\kohya\kohya_ss\venv\Lib\site-packages\bitsandbytes\cuda_setup\main.py'.
At line:13 char:1
+ cp .\bitsandbytes_windows\main.py .\venv\Lib\site-packages\bitsandbyt ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Copy-Item], DirectoryNotFoundException
    + FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.PowerShell.Commands.CopyItemCommand

accelerate : The term 'accelerate' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:15 char:1
+ accelerate config
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (accelerate:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
bmaltais commented 1 year ago

Somehow the command you propose does not work properly my system. Are you running python 3.10.9 installed as per the instructions? You appear to run myltiple version. How are they installed?

Nemiander commented 1 year ago

Yeah i did update the version from 3.10.6 when i was trying to figure it out. So it is up to 3.10.9. I have anaconda and pycharm if that makes a difference.

bmaltais commented 1 year ago

This is probably why the command you proposed woprk for you but not for me... I won't be able to add it as it would probably not work for most users. It probably work because of anaconda.

Nemiander commented 1 year ago

Yeah i agree.