0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[できなかった] Stable diffusionでLoraを作る。M1macbookpro

Posted at

概要

環境
Macboonpro:M1pro
python:3.10.9
pip: 25.1
pytorch:2.8.0.dev20250613

手順

自分の環境ではpythonが規定のversionに足りていないため、再度インストールをした。

(base) ware@warenoMacBook-Pro kohya_ss %pyenv install 3.10.9
(base) ware@warenoMacBook-Pro kohya_ss % pyenv global 3.10.9
(base) ware@warenoMacBook-Pro kohya_ss % 
(base) ware@warenoMacBook-Pro kohya_ss % python --version    
Python 3.10.9
(base) ware@warenoMacBook-Pro kohya_ss %

さらに、pipのバージョンが21程度だと途中でエラーが起こるので、アップグレードした。

python -m pip install --upgrade pip

自分は25.1を使っている。

(base) ware@warenoMacBook-Pro kohya_ss % pip --version
pip 25.1.1 from /opt/homebrew/Caskroom/miniconda/base/lib/python3.9/site-packages/pip (python 3.9)
(base) ware@warenoMacBook-Pro kohya_ss % 

以下のコマンドで、仮想環境を作る

python -m venv venv
(最新版の環境で行いたいなら、python -m venv myenv --upgrade-deps。3.10系以降なら使える。)

source venv/bin/activate

実行結果。venvと新しくつけばOK。

実行結果
(base) itoudaiware@itoudaiwarenoMacBook-Pro ~ % source venv/bin/activate
(venv) (base) itoudaiware@itoudaiwarenoMacBook-Pro ~ % 
(venv) (base) itoudaiware@itoudaiwarenoMacBook-Pro ~ % 

その後、以下のコマンドでgitからcloneする。

git clone https://github.com/bmaltais/kohya_ss.git

その後、以下のコマンドでセットアップを行う。git cloneしたフォルダに移動し、.setup.shを実行する形。

cd kohya_ss 
./setup.sh

実行結果。。なんかERRORというのが出てはいる。

(venv) (base) itoudaiware@itoudaiwarenoMacBook-Pro kohya_ss % ./setup.sh
Installing Python 3.10 if not found.
Python 3.10 found!
Installing Python-TK 3.10 if not found.
Python Tkinter 3.10 found!
Skipping git operations.
Switching to virtual Python environment.
[06/14/25 17:02:03] INFO     Python version is 3.10.9 (main,  setup_common.py:28
                             Jun 14 2025, 16:53:22) [Clang                      
                             17.0.0 (clang-1700.0.13.3)]                        
[06/14/25 17:02:06] INFO     Submodule initialized and        setup_common.py:53
                             updated.                                           
                    INFO     Installing python dependencies.   setup_linux.py:14
                             This could take a few minutes as                   
                             it downloads files.                                
                    INFO     If this operation ever runs too   setup_linux.py:15
                             long, you can rerun this script                    
                             in verbose mode to check.                          
                    INFO     Kohya_ss GUI version: v25.1.2   setup_common.py:377
                                                                                
                    INFO     Installing/Validating           setup_common.py:161
                             requirements from                                  
                             requirements_macos_arm64.txt...                    
                    INFO     Looking in indexes:             setup_common.py:189
                             https://pypi.org/simple,                           
                             https://download.pytorch.org/wh                    
                             l/nightly/cpu                                      
                    INFO     Collecting                      setup_common.py:189
                             git+https://github.com/bitsandb                    
                             ytes-foundation/bitsandbytes.gi                    
                             t/#0.45.5 (from -r                                 
                             requirements_macos_arm64.txt                       
                             (line 5))                                          
                    INFO     Cloning                         setup_common.py:189
                             https://github.com/bitsandbytes                    
                             -foundation/bitsandbytes.git/                      
                             to                                                 
                             /private/var/folders/08/10mf9jb                    
                             94rl30dv90pv6372h0000gn/T/pip-r                    
                             eq-build-gm_bqfjl                                  
[06/14/25 17:02:08] INFO     Resolved                        setup_common.py:189
                             https://github.com/bitsandbytes                    
                             -foundation/bitsandbytes.git/                      
                             to commit                                          
                             d863adb229516759d919b3e031cde45                    
                             36a8bbc37                                          
                    INFO     Installing build dependencies:  setup_common.py:189
                             started                                            
[06/14/25 17:02:10] INFO     Installing build dependencies:  setup_common.py:189
                             finished with status 'done'                        
                    INFO     Getting requirements to build   setup_common.py:189
                             wheel: started                                     
                    INFO     Getting requirements to build   setup_common.py:189
                             wheel: finished with status                        
                             'done'                                             
                    INFO     Preparing metadata              setup_common.py:189
                             (pyproject.toml): started                          
[06/14/25 17:02:11] INFO     Preparing metadata              setup_common.py:189
                             (pyproject.toml): finished with                    
                             status 'done'                                      
                    INFO     Obtaining                       setup_common.py:189
                             file:///Users/itoudaiware/kohya                    
                             _ss/sd-scripts (from -r                            
                             requirements.txt (line 38))                        
                    INFO     Preparing metadata (setup.py):  setup_common.py:189
                             started                                            
                    INFO     Preparing metadata (setup.py):  setup_common.py:189
                             finished with status 'done'                        
[06/14/25 17:02:12] ERROR    Failed to install requirements: setup_common.py:194
                             Running command git clone                          
                             --filter=blob:none --quiet               略。。                            
                       
Exiting Python virtual environment.
Copying accelerate config file to: /Users/itoudaiware/.cache/huggingface/accelerate/default_config.yaml
Setup finished! Run ./gui.sh to start.
(venv) (base) itoudaiware@itoudaiwarenoMacBook-Pro kohya_ss % 

もしかしたら、まだモジュールが足りていないとかそういうことかもしれないと思い、とりあえず先に以下のコマンドでモジュールをインストールしておく。

pip install -U -r requirements.txt

色々やって試したが、pytorch2.8系を入れろと言われているようだ。2.8系は通常のpipではインストールできないので、以下のコマンドで開発版を明示的に入れる。しかし、結論これをいれても動かなかった。意味なし。

pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
pip install tensorflow torchmetrics

その後、以下のコマンドで起動させる。

./gui.sh

やはりエラーが出る。

(venv) (base) itoudaiware@itoudaiwarenoMacBook-Pro kohya_ss % ./gui.sh
Warning: LD_LIBRARY_PATH environment variable is not set.
Certain functionalities may not work correctly.
Please ensure that the required libraries are properly configured.
 
If you use WSL2 you may want to: export LD_LIBRARY_PATH=/usr/lib/wsl/lib/
 
Traceback (most recent call last):
  File "/Users/itoudaiware/kohya_ss/kohya_gui.py", line 6, in <module>
    import gradio as gr
ModuleNotFoundError: No module named 'gradio'
(venv) (base) itoudaiware@itoudaiwarenoMacBook-Pro

2025年

参考ページ

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?