使用LORA模型训练时报错:ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。



```python
ConnectionError: (ProtocolError('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。',None, 10054, None)), '(Request ID: 3ea461dc-e370-40a3-b22c-da43a77588a5)')
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ D:\rjr\software\Python10\lib\runpy.py:196 in _run_module_as_main                                 │
│                                                                                                  │
│   193 │   main_globals = sys.modules["__main__"].__dict__                                        │
│   194if alter_argv:                                                                         │
│   195 │   │   sys.argv[0] = mod_spec.origin                                                      │
│ ❱ 196return _run_code(code, main_globals, None,                                             │
│   197 │   │   │   │   │    "__main__", mod_spec)                                                 │
│   198                                                                                            │
│   199 def run_module(mod_name, init_globals=None,                                                │
│                                                                                                  │
│ D:\rjr\software\Python10\lib\runpy.py:86 in _run_code                                            │
│                                                                                                  │
│    83 │   │   │   │   │      __loader__ = loader,                                                │
│    84 │   │   │   │   │      __package__ = pkg_name,                                             │
│    85 │   │   │   │   │      __spec__ = mod_spec)                                                │
│ ❱  86 │   exec(code, run_globals)                                                                │
│    87return run_globals                                                                     │
│    88                                                                                            │
│    89 def _run_module_code(code, init_globals=None,                                              │
│                                                                                                  │
│ in <module>:7                                                                                    │
│                                                                                                  │
│   4 from accelerate.commands.accelerate_cli import main                                          │
│   5 if __name__ == '__main__':                                                                   │
│   6 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│ ❱ 7 │   sys.exit(main())                                                                         │
│   8                                                                                              │
│                                                                                                  │
│ D:\fcp\stable-webui\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py:45 in  │
│ main                                                                                             │
│                                                                                                  │
│   42 │   │   exit(1)                                                                             │
│   43 │                                                                                           │
│   44 │   # Run                                                                                   │
│ ❱ 45 │   args.func(args)                                                                         │
│   46                                                                                             │
│   47                                                                                             │
│   48 if __name__ == "__main__":                                                                  │
│                                                                                                  │
│ D:\fcp\stable-webui\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py:918 in         │
│ launch_command                                                                                   │
│                                                                                                  │
│   915 │   elif defaults is not None and defaults.compute_environment == ComputeEnvironment.AMA   │
│   916 │   │   sagemaker_launcher(defaults, args)                                                 │
│   917else:                                                                                  │
│ ❱ 918 │   │   simple_launcher(args)                                                              │
│   919                                                                                            │
│   920                                                                                            │
│   921 def main():                                                                                │
│                                                                                                  │
│ D:\fcp\stable-webui\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py:580 in         │
│ simple_launcher                                                                                  │
│                                                                                                  │
│   577 │   process.wait()                                                                         │
│   578if process.returncode != 0:                                                            │
│   579 │   │   if not args.quiet:                                                                 │
│ ❱ 580 │   │   │   raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)    │
│   581 │   │   else:                                                                              │
│   582 │   │   │   sys.exit(1)                                                                    │
│   583                                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
CalledProcessError: Command '['D:\\fcp\\stable-webui\\kohya_ss\\venv\\Scripts\\python.exe', './train_network.py',
'--enable_bucket', '--min_bucket_reso=256', '--max_bucket_reso=2048',
'--pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5',
'--train_data_dir=D:\\fcp\\color_transfer\\pytorch-CycleGAN-and-pix2pix-master\\pytorch-CycleGAN-and-pix2pix-master\\datasets\\AOPI\\LoRA\\image', '--resolution=512,512',
'--output_dir=D:\\fcp\\color_transfer\\pytorch-CycleGAN-and-pix2pix-master\\pytorch-CycleGAN-and-pix2pix-master\\datasets\\AOPI\\LoRA\\model',
'--logging_dir=D:\\fcp\\color_transfer\\pytorch-CycleGAN-and-pix2pix-master\\pytorch-CycleGAN-and-pix2pix-master\\datasets\\AOPI\\LoRA\\log', '--network_alpha=128', '--save_model_as=safetensors', '--network_module=networks.lora',
'--text_encoder_lr=5e-05', '--unet_lr=0.0001', '--network_dim=128', '--output_name=aixiaowangzi',
'--lr_scheduler_num_cycles=50', '--no_half_vae', '--learning_rate=0.0001', '--lr_scheduler=cosine_with_restarts',
'--lr_warmup_steps=50000', '--train_batch_size=2', '--max_train_steps=500000', '--save_every_n_epochs=5',
'--mixed_precision=fp16', '--save_precision=fp16', '--caption_extension=.txt', '--cache_latents',
'--optimizer_type=AdamW8bit', '--max_data_loader_n_workers=1', '--clip_skip=2', '--bucket_reso_steps=64',
'--bucket_no_upscale']' returned non-zero exit status 1.




```python  
ConnectionError: (ProtocolError('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。',None, 10054, None)), '(Request ID: 3ea461dc-e370-40a3-b22c-da43a77588a5)')  
```python  
胃肠感冒又称“吐泻型食物中毒”,夏秋季节发病率较高,在医疗体系尚不完善的偏远地区,往往因脱水造成周边的循环衰竭,甚至危及生命。