facechain icon indicating copy to clipboard operation
facechain copied to clipboard

ModuleNotFoundError: No module named 'torch.nn'

Open cjh1228 opened this issue 2 years ago • 1 comments

instance_data_dir D:\stable-diffusion-webui\extensions\facechain\worker_data\qw\training_data\ly261666/cv_portrait_model\person1 Traceback (most recent call last): File "D:\stable-diffusion-webui\extensions\facechain\facechain\train_text_to_image_lora.py", line 37, in import torch.nn.functional as F ModuleNotFoundError: No module named 'torch.nn' 提示:Python 运行时抛出了一个异常。请检查疑难解答页面。 Error executing the command: Command '['python', 'D:\stable-diffusion-webui\extensions\facechain/facechain/train_text_to_image_lora.py', '--pretrained_model_name_or_path=ly261666/cv_portrait_model', '--revision=v2.0', '--sub_path=film/film', '--output_dataset_name=D:\stable-diffusion-webui\extensions\facechain\worker_data\qw\training_data\ly261666/cv_portrait_model\person1', '--caption_column=text', '--resolution=512', '--random_flip', '--train_batch_size=1', '--num_train_epochs=200', '--checkpointing_steps=5000', '--learning_rate=1.5e-04', '--lr_scheduler=cosine', '--lr_warmup_steps=0', '--seed=42', '--output_dir=D:\stable-diffusion-webui\extensions\facechain\worker_data\qw\ly261666/cv_portrait_model\person1', '--lora_r=4', '--lora_alpha=32', '--lora_text_encoder_r=32', '--lora_text_encoder_alpha=32', '--resume_from_checkpoint=fromfacecommon']' returned non-zero exit status 1. Traceback (most recent call last): File "D:\stable-diffusion-webui\extensions\facechain\app.py", line 147, in train_lora_fn subprocess.run(command, check=True) File "C:\Users\chenyu\miniconda3\lib\subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['python', 'D:\stable-diffusion-webui\extensions\facechain/facechain/train_text_to_image_lora.py', '--pretrained_model_name_or_path=ly261666/cv_portrait_model', '--revision=v2.0', '--sub_path=film/film', '--output_dataset_name=D:\stable-diffusion-webui\extensions\facechain\worker_data\qw\training_data\ly261666/cv_portrait_model\person1', '--caption_column=text', '--resolution=512', '--random_flip', '--train_batch_size=1', '--num_train_epochs=200', '--checkpointing_steps=5000', '--learning_rate=1.5e-04', '--lr_scheduler=cosine', '--lr_warmup_steps=0', '--seed=42', '--output_dir=D:\stable-diffusion-webui\extensions\facechain\worker_data\qw\ly261666/cv_portrait_model\person1', '--lora_r=4', '--lora_alpha=32', '--lora_text_encoder_r=32', '--lora_text_encoder_alpha=32', '--resume_from_checkpoint=fromfacecommon']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api result = await self.call_function( File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function prediction = await anyio.to_thread.run_sync( File "D:\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "D:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "D:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, *args) File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper response = f(*args, **kwargs) File "D:\stable-diffusion-webui\extensions\facechain\app.py", line 804, in run train_lora_fn(base_model_path=base_model_path, File "D:\stable-diffusion-webui\extensions\facechain\app.py", line 150, in train_lora_fn raise gr.Error("训练失败 (Training failed)") gradio.exceptions.Error: '训练失败 (Training failed)'

cjh1228 avatar Dec 25 '23 12:12 cjh1228

I just installed today and I am getting this same error.

ArnorWing avatar Jan 01 '24 09:01 ArnorWing

please try out the newest train-free, 10s inference version facechain-fact.

sunbaigui avatar Jun 04 '24 09:06 sunbaigui