Closed theussong closed 3 months ago
This is a classical bug under venv, the subprocess.run
in app.py forget to pass os.environ
, so the env in sub process turns to global.
I don't know whether facechain will change PATH
in train_text_to_image_lora.py, thought I still use subprocess.Popen
interimly. This is not safe for main process.
For line 88 in app.py, windows command has been changed by me as:
f'{%your-stable-diffusion-dir%/venv/Scripts/python.exe}', f'{project_dir}/facechain/train_text_to_image_lora.py',
For line 112 in app.py, 'try' code has been changed by me as:
my_env = os.environ subprocess.Popen(command, env=my_env)
This worked for me. To be specific, here has dissussed this problem. Hope writer can handle this special scenario in stable-diffusion-webui later.
Please install mmcv with:
min install mmcv-full==1.7.2
ref: https://mmcv.readthedocs.io/en/latest/get_started/installation.html
facechain 项目下 install.py 文件修改 #32 install mmcv-full==1.7.2
facechain 项目下 install.py 文件修改 32行 install mmcv-full==1.7.2
please try out the newest train-free, 10s inference version facechain-fact.
在上传图片后,开始训练,报如下错误
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] Version: v1.6.0-2-g4afaaf8a Commit hash: 4afaaf8a020c1df457bcf7250cb1c7f609699fa7 --installing mmcv... Installing requirements for mmcv Couldn't install requirements for mmcv. Command: "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\python\python.exe" -m pip install mmcv-full==1.7.0 --prefer-binary Error code: 1 stdout: Looking in indexes: https://mirror.baidu.com/pypi/simple Looking in links: https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html Collecting mmcv-full==1.7.0 Using cached https://mirror.baidu.com/pypi/packages/a1/81/89120850923f4c8b49efba81af30160e7b1b305fdfa9671a661705a8abbf/mmcv-full-1.7.0.tar.gz (593 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done'
stderr: ERROR: No .egg-info directory found in C:\Users\zhuga\AppData\Local\Temp\pip-pip-egg-info-a9871d0t
ERROR facechain: failed to install mmcv, make sure to have "CUDA Toolkit" and "Build Tools for Visual Studio" installed is_installed check for tensorflow-cpu failed as 'spec is None' Installing requirements for easyphoto-webui Installing requirements for tensorflow Installing requirements for easyphoto-webui Installing requirements for invisible-watermark Launching Web UI with arguments: --theme dark --port 7861 --xformers --api --autolaunch --share --server-name 10.0.50.33
========================= a1111-sd-webui-lycoris ========================= Starting from stable-diffusion-webui version 1.5.0 a1111-sd-webui-lycoris extension is no longer needed
All its features have been integrated into the native LoRA extension LyCORIS models can now be used as if there are regular LoRA models
This extension has been automatically deactivated Please remove this extension
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu. 2023-11-10 16:18:01,202 - modelscope - INFO - PyTorch version 2.0.1+cu118 Found. 2023-11-10 16:18:01,205 - modelscope - INFO - TensorFlow version 2.14.0 Found. 2023-11-10 16:18:01,205 - modelscope - INFO - Loading ast index from C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4.cache\modelscope\hub\ast_indexer 2023-11-10 16:18:01,290 - modelscope - INFO - Loading done! Current index file version is 1.9.3, with md5 5fedc4aff6233fa2760da71fa82bf83e and a total number of 943 components indexed [AddNet] Updating model hashes... [AddNet] Updating model hashes... 2023-11-10 16:18:02,627 - ControlNet - INFO - ControlNet v1.1.416 ControlNet preprocessor location: C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\extensions\sd-webui-controlnet\annotator\downloads 2023-11-10 16:18:02,740 - ControlNet - INFO - ControlNet v1.1.416 sd-webui-prompt-all-in-one background API service started successfully. Loading weights [d7e2ac2f4a] from C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\models\Stable-diffusion\majicMIX realistic 麦橘写实_v2威力加强典藏版.safetensors Creating model from config: C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\configs\v1-inference.yaml [['C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\extensions\facechain/resources/inpaint_template\1.jpg'], ['C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\extensions\facechain/resources/inpaint_template\2.jpg'], ['C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\extensions\facechain/resources/inpaint_template\3.jpg'], ['C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\extensions\facechain/resources/inpaint_template\4.jpg'], ['C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\extensions\facechain/resources/inpaint_template\5.jpg']] [] Running on local URL: http://10.0.50.33:7861 Applying attention optimization: xformers... done. Model loaded in 2.2s (load weights from disk: 0.5s, load config: 0.2s, create model: 0.2s, apply weights to model: 1.0s).
Could not create share link. Missing file: C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\python\lib\site-packages\gradio\frpc_windows_amd64_v0.2.
Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps:
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\python\lib\site-packages\gradio\routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api result = await self.call_function( File "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\python\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\python\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\python\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, args) File "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\python\lib\site-packages\gradio\utils.py", line 707, in wrapper response = f(args, kwargs) File "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\extensions\facechain\app.py", line 691, in run train_lora_fn(base_model_path=base_model_path, File "C:\Users\zhuga\stable-diffusion\sd-webui-aki-v4.4\extensions\facechain\app.py", line 114, in train_lora_fn raise gr.Error("训练失败 (Training failed)") gradio.exceptions.Error: '训练失败 (Training failed)'**