aigc-apps / sd-webui-EasyPhoto

📷 EasyPhoto | Your Smart AI Photo Generator.
Apache License 2.0
4.98k stars 399 forks source link

FileNotFoundError: [Errno 2] No such file or directory: #10

Closed daxijiu closed 1 year ago

daxijiu commented 1 year ago

fixed by https://github.com/aigc-apps/sd-webui-EasyPhoto/pull/13

=============== 开始训练如下报错: FileNotFoundError: [Errno 2] No such file or directory: 'D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\user_weights\best_outputs/lyf.safetensors'

lyf是起的id 完整log pplied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0 Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0 Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5 set det-size: (640, 640) 2023-09-04 22:40:00,481 - modelscope - INFO - Model revision not specified, use the latest revision: v2.0.2 2023-09-04 22:40:02,213 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface 2023-09-04 22:40:02,214 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface. 2023-09-04 22:40:02,216 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-04 22:40:02,216 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-04 22:40:02,216 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\zcn6842\.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface'}. trying to build by task and model information. 2023-09-04 22:40:02,216 - modelscope - WARNING - Find task: face-detection, model type: None. Insufficient information to build preprocessor, skip building preprocessor 2023-09-04 22:40:02,218 - modelscope - INFO - loading model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface\pytorch_model.pt 2023-09-04 22:40:02,513 - modelscope - INFO - load model done 2023-09-04 22:40:02,921 - modelscope - INFO - Model revision not specified, use the latest revision: v1.0.0 2023-09-04 22:40:03,086 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_u2net_salient-detection 2023-09-04 22:40:03,086 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_u2net_salient-detection. 2023-09-04 22:40:03,087 - modelscope - INFO - initialize model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_u2net_salient-detection 2023-09-04 22:40:03,303 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-04 22:40:03,303 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-04 22:40:03,304 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\zcn6842\.cache\modelscope\hub\damo\cv_u2net_salient-detection'}. trying to build by task and model information. 2023-09-04 22:40:03,304 - modelscope - WARNING - No preprocessor key ('detection', 'semantic-segmentation') found in PREPROCESSOR_MAP, skip building preprocessor. 2023-09-04 22:40:03,703 - modelscope - INFO - Use user-specified model revision: v1.0.1 2023-09-04 22:40:03,891 - modelscope - WARNING - ('PIPELINES', 'skin-retouching-torch', 'skin-retouching-torch') not found in ast index file 2023-09-04 22:40:03,891 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_unet_skin_retouching_torch 2023-09-04 22:40:03,891 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_unet_skin_retouching_torch. 2023-09-04 22:40:03,894 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-04 22:40:03,894 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-04 22:40:03,894 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\zcn6842\.cache\modelscope\hub\damo\cv_unet_skin_retouching_torch'}. trying to build by task and model information. 2023-09-04 22:40:03,894 - modelscope - WARNING - Find task: skin-retouching-torch, model type: None. Insufficient information to build preprocessor, skip building preprocessor 2023-09-04 22:40:04,522 - modelscope - INFO - Model revision not specified, use the latest revision: v2.0.2 2023-09-04 22:40:06,310 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface 2023-09-04 22:40:06,310 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface. 2023-09-04 22:40:06,315 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-04 22:40:06,315 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-04 22:40:06,315 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\zcn6842\.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface'}. trying to build by task and model information. 2023-09-04 22:40:06,315 - modelscope - WARNING - Find task: face-detection, model type: None. Insufficient information to build preprocessor, skip building preprocessor 2023-09-04 22:40:06,317 - modelscope - INFO - loading model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface\pytorch_model.pt 2023-09-04 22:40:06,627 - modelscope - INFO - load model done 2023-09-04 22:40:08,332 - modelscope - INFO - Model revision not specified, use the latest revision: v1.0.0 2023-09-04 22:40:08,652 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_gpen_image-portrait-enhancement 2023-09-04 22:40:08,653 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_gpen_image-portrait-enhancement. 2023-09-04 22:40:08,653 - modelscope - INFO - initialize model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_gpen_image-portrait-enhancement Loading ResNet ArcFace 2023-09-04 22:40:10,276 - modelscope - INFO - load face enhancer model done 2023-09-04 22:40:10,553 - modelscope - INFO - load face detector model done 2023-09-04 22:40:10,826 - modelscope - INFO - load sr model done 2023-09-04 22:40:11,490 - modelscope - INFO - load fqa model done selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\5.jpg total scores: 0.6234065605623983 face angles 0.9548858022264274 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\2.jpg total scores: 0.6102422407964487 face angles 0.9395583143659086 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\0.jpg total scores: 0.5969747537782216 face angles 0.9589047791489895 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\4.jpg total scores: 0.5931145356793212 face angles 0.9300448887992161 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\3.jpg total scores: 0.5681950943441831 face angles 0.9556665541133954 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\6.jpg total scores: 0.5567725630669526 face angles 0.9620961552431176 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\1.jpg total scores: 0.49141735771875494 face angles 0.7661806085455679 jpg: 5.jpg face_id_scores 0.6234065605623983 jpg: 2.jpg face_id_scores 0.6102422407964487 jpg: 1.jpg face_id_scores 0.49141735771875494 jpg: 4.jpg face_id_scores 0.5931145356793212 jpg: 0.jpg face_id_scores 0.5969747537782216 jpg: 3.jpg face_id_scores 0.5681950943441831 jpg: 6.jpg face_id_scores 0.5567725630669526 2023-09-04 22:40:15,963 - modelscope - WARNING - task skin-retouching-torch input definition is missing 2023-09-04 22:40:16,999 - modelscope - WARNING - task skin-retouching-torch output keys are missing 2023-09-04 22:40:17,175 - modelscope - WARNING - task semantic-segmentation input definition is missing save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\0.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\1.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\2.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\3.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\4.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\5.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\6.jpg D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\scripts\train_kohya/train_lora.py Error executing the command: Command '['accelerate', 'launch', '--mixed_precision=fp16', '--main_process_port=3456', 'D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\scripts\train_kohya/train_lora.py', '--pretrained_model_name_or_path=extensions\sd-webui-EasyPhoto\models\stable-diffusion-v1-5', '--pretrained_model_ckpt=models\Stable-diffusion\Chilloutmix-Ni-pruned-fp16-fix.safetensors', '--train_data_dir=outputs\easyphoto-user-id-infos\lyf\processed_images', '--caption_column=text', '--resolution=512', '--random_flip', '--train_batch_size=1', '--gradient_accumulation_steps=4', '--dataloader_num_workers=0', '--max_train_steps=800', '--checkpointing_steps=100', '--learning_rate=0.0001', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--train_text_encoder', '--seed=42', '--rank=128', '--network_alpha=64', '--validation_prompt=easyphoto_face, easyphoto, 1person', '--validation_steps=100', '--output_dir=outputs\easyphoto-user-id-infos\lyf\user_weights', '--logging_dir=outputs\easyphoto-user-id-infos\lyf\user_weights', '--enable_xformers_memory_efficient_attention', '--mixed_precision=fp16', '--template_dir=extensions\sd-webui-EasyPhoto\models\training_templates', '--template_mask', '--merge_best_lora_based_face_id', '--merge_best_lora_name=lyf']' returned non-zero exit status 1. Traceback (most recent call last): File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\gradio\routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\gradio\blocks.py", line 1431, in process_api result = await self.call_function( File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\gradio\blocks.py", line 1103, in call_function prediction = await anyio.to_thread.run_sync( File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\gradio\utils.py", line 707, in wrapper response = f(args, **kwargs) File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\scripts\easyphoto_train.py", line 216, in easyphoto_train_forward copyfile(best_weight_path, webui_save_path) File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\shutil.py", line 254, in copyfile with open(src, 'rb') as fsrc: FileNotFoundError: [Errno 2] No such file or directory: 'D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\user_weights\best_outputs/lyf.safetensors' 提示:Python 运行时抛出了一个异常。请检查疑难解答页面。

bubbliiiing commented 1 year ago

开始训练如下报错: FileNotFoundError: [Errno 2] No such file or directory: 'D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\user_weights\best_outputs/lyf.safetensors'

lyf是起的id 完整log pplied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0 Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0 Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5 set det-size: (640, 640) 2023-09-04 22:40:00,481 - modelscope - INFO - Model revision not specified, use the latest revision: v2.0.2 2023-09-04 22:40:02,213 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface 2023-09-04 22:40:02,214 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface. 2023-09-04 22:40:02,216 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-04 22:40:02,216 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-04 22:40:02,216 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface'}. trying to build by task and model information. 2023-09-04 22:40:02,216 - modelscope - WARNING - Find task: face-detection, model type: None. Insufficient information to build preprocessor, skip building preprocessor 2023-09-04 22:40:02,218 - modelscope - INFO - loading model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface\pytorch_model.pt 2023-09-04 22:40:02,513 - modelscope - INFO - load model done 2023-09-04 22:40:02,921 - modelscope - INFO - Model revision not specified, use the latest revision: v1.0.0 2023-09-04 22:40:03,086 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_u2net_salient-detection 2023-09-04 22:40:03,086 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_u2net_salient-detection. 2023-09-04 22:40:03,087 - modelscope - INFO - initialize model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_u2net_salient-detection 2023-09-04 22:40:03,303 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-04 22:40:03,303 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-04 22:40:03,304 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\zcn6842.cache\modelscope\hub\damo\cv_u2net_salient-detection'}. trying to build by task and model information. 2023-09-04 22:40:03,304 - modelscope - WARNING - No preprocessor key ('detection', 'semantic-segmentation') found in PREPROCESSOR_MAP, skip building preprocessor. 2023-09-04 22:40:03,703 - modelscope - INFO - Use user-specified model revision: v1.0.1 2023-09-04 22:40:03,891 - modelscope - WARNING - ('PIPELINES', 'skin-retouching-torch', 'skin-retouching-torch') not found in ast index file 2023-09-04 22:40:03,891 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_unet_skin_retouching_torch 2023-09-04 22:40:03,891 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_unet_skin_retouching_torch. 2023-09-04 22:40:03,894 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-04 22:40:03,894 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-04 22:40:03,894 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\zcn6842.cache\modelscope\hub\damo\cv_unet_skin_retouching_torch'}. trying to build by task and model information. 2023-09-04 22:40:03,894 - modelscope - WARNING - Find task: skin-retouching-torch, model type: None. Insufficient information to build preprocessor, skip building preprocessor 2023-09-04 22:40:04,522 - modelscope - INFO - Model revision not specified, use the latest revision: v2.0.2 2023-09-04 22:40:06,310 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface 2023-09-04 22:40:06,310 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface. 2023-09-04 22:40:06,315 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-04 22:40:06,315 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-04 22:40:06,315 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface'}. trying to build by task and model information. 2023-09-04 22:40:06,315 - modelscope - WARNING - Find task: face-detection, model type: None. Insufficient information to build preprocessor, skip building preprocessor 2023-09-04 22:40:06,317 - modelscope - INFO - loading model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_resnet50_face-detection_retinaface\pytorch_model.pt 2023-09-04 22:40:06,627 - modelscope - INFO - load model done 2023-09-04 22:40:08,332 - modelscope - INFO - Model revision not specified, use the latest revision: v1.0.0 2023-09-04 22:40:08,652 - modelscope - INFO - initiate model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_gpen_image-portrait-enhancement 2023-09-04 22:40:08,653 - modelscope - INFO - initiate model from location C:\Users\zcn6842.cache\modelscope\hub\damo\cv_gpen_image-portrait-enhancement. 2023-09-04 22:40:08,653 - modelscope - INFO - initialize model from C:\Users\zcn6842.cache\modelscope\hub\damo\cv_gpen_image-portrait-enhancement Loading ResNet ArcFace 2023-09-04 22:40:10,276 - modelscope - INFO - load face enhancer model done 2023-09-04 22:40:10,553 - modelscope - INFO - load face detector model done 2023-09-04 22:40:10,826 - modelscope - INFO - load sr model done 2023-09-04 22:40:11,490 - modelscope - INFO - load fqa model done selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\5.jpg total scores: 0.6234065605623983 face angles 0.9548858022264274 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\2.jpg total scores: 0.6102422407964487 face angles 0.9395583143659086 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\0.jpg total scores: 0.5969747537782216 face angles 0.9589047791489895 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\4.jpg total scores: 0.5931145356793212 face angles 0.9300448887992161 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\3.jpg total scores: 0.5681950943441831 face angles 0.9556665541133954 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\6.jpg total scores: 0.5567725630669526 face angles 0.9620961552431176 selected paths: D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\original_backup\1.jpg total scores: 0.49141735771875494 face angles 0.7661806085455679 jpg: 5.jpg face_id_scores 0.6234065605623983 jpg: 2.jpg face_id_scores 0.6102422407964487 jpg: 1.jpg face_id_scores 0.49141735771875494 jpg: 4.jpg face_id_scores 0.5931145356793212 jpg: 0.jpg face_id_scores 0.5969747537782216 jpg: 3.jpg face_id_scores 0.5681950943441831 jpg: 6.jpg face_id_scores 0.5567725630669526 2023-09-04 22:40:15,963 - modelscope - WARNING - task skin-retouching-torch input definition is missing 2023-09-04 22:40:16,999 - modelscope - WARNING - task skin-retouching-torch output keys are missing 2023-09-04 22:40:17,175 - modelscope - WARNING - task semantic-segmentation input definition is missing save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\0.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\1.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\2.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\3.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\4.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\5.jpg save processed image to D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\processed_images\train\6.jpg D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\scripts\train_kohya/train_lora.py Error executing the command: Command '['accelerate', 'launch', '--mixed_precision=fp16', '--main_process_port=3456', 'D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\scripts\train_kohya/train_lora.py', '--pretrained_model_name_or_path=extensions\sd-webui-EasyPhoto\models\stable-diffusion-v1-5', '--pretrained_model_ckpt=models\Stable-diffusion\Chilloutmix-Ni-pruned-fp16-fix.safetensors', '--train_data_dir=outputs\easyphoto-user-id-infos\lyf\processed_images', '--caption_column=text', '--resolution=512', '--random_flip', '--train_batch_size=1', '--gradient_accumulation_steps=4', '--dataloader_num_workers=0', '--max_train_steps=800', '--checkpointing_steps=100', '--learning_rate=0.0001', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--train_text_encoder', '--seed=42', '--rank=128', '--network_alpha=64', '--validation_prompt=easyphoto_face, easyphoto, 1person', '--validation_steps=100', '--output_dir=outputs\easyphoto-user-id-infos\lyf\user_weights', '--logging_dir=outputs\easyphoto-user-id-infos\lyf\user_weights', '--enable_xformers_memory_efficient_attention', '--mixed_precision=fp16', '--template_dir=extensions\sd-webui-EasyPhoto\models\training_templates', '--template_mask', '--merge_best_lora_based_face_id', '--merge_best_lora_name=lyf']' returned non-zero exit status 1. Traceback (most recent call last): File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\gradio\routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\gradio\blocks.py", line 1431, in process_api result = await self.call_function( File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\gradio\blocks.py", line 1103, in call_function prediction = await anyio.to_thread.run_sync( File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\site-packages\gradio\utils.py", line 707, in wrapper response = f(args, **kwargs) File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\scripts\easyphoto_train.py", line 216, in easyphoto_train_forward copyfile(best_weight_path, webui_save_path) File "D:\kkkkk\release\SD_webui_with_aki_launcher_dev\py310\lib\shutil.py", line 254, in copyfile with open(src, 'rb') as fsrc: FileNotFoundError: [Errno 2] No such file or directory: 'D:\kkkkk\release\SD_webui_with_aki_launcher_dev\outputs/easyphoto-user-id-infos\lyf\user_weights\best_outputs/lyf.safetensors' 提示:Python 运行时抛出了一个异常。请检查疑难解答页面。

错误原因在于并未成功执行,可以看看pip情况吗 Error executing the command: Command '['accelerate', 'launch', '--mixed_precision=fp16', '--main_process_port=3456', 'D:\kkkkk\release\SD_webui_with_aki_launcher_dev\extensions\sd-webui-EasyPhoto\scripts\train_kohya/train_lora.py', '--pretrained_model_name_or_path=extensions\sd-webui-EasyPhoto\models\stable-diffusion-v1-5', '--pretrained_model_ckpt=models\Stable-diffusion\Chilloutmix-Ni-pruned-fp16-fix.safetensors', '--train_data_dir=outputs\easyphoto-user-id-infos\lyf\processed_images', '--caption_column=text', '--resolution=512', '--random_flip', '--train_batch_size=1', '--gradient_accumulation_steps=4', '--dataloader_num_workers=0', '--max_train_steps=800', '--checkpointing_steps=100', '--learning_rate=0.0001', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--train_text_encoder', '--seed=42', '--rank=128', '--network_alpha=64', '--validation_prompt=easyphoto_face, easyphoto, 1person', '--validation_steps=100', '--output_dir=outputs\easyphoto-user-id-infos\lyf\user_weights', '--logging_dir=outputs\easyphoto-user-id-infos\lyf\user_weights', '--enable_xformers_memory_efficient_attention', '--mixed_precision=fp16', '--template_dir=extensions\sd-webui-EasyPhoto\models\training_templates', '--template_mask', '--merge_best_lora_based_face_id', '--merge_best_lora_name=lyf']' returned non-zero exit status 1.

bubbliiiing commented 1 year ago

简单来讲没有执行训练过程,感觉可能是accelerate的问题

daxijiu commented 1 year ago

为了排查问题,我特意建立了两个环境: 环境1 全新check的webui 1.6.0正式版 只安装如下插件 controlnet EasyPhoto 使用webui自带的webui-user.bat启动建立venv虚拟环境

环境2 全新check的webui 1.6.0正式版 只安装如下插件 controlnet EasyPhoto 使用webui自带的webui-user.bat手动编辑python和git路径,并且禁止使用虚拟环境(这也是webui官方支持的,市面上主流整合包例如秋叶、星空都是这个原理)

============================

问题依旧,经过排查,训练时调用的python和accelerate并不是虚拟环境或者指定python路径下的,而是系统本机的 而系统本机不一定有accelerate甚至python

bubbliiiing commented 1 year ago

为了排查问题,我特意建立了两个环境: 环境1 全新check的webui 1.6.0正式版 只安装如下插件 controlnet EasyPhoto 使用webui自带的webui-user.bat启动建立venv虚拟环境

环境2 全新check的webui 1.6.0正式版 只安装如下插件 controlnet EasyPhoto 使用webui自带的webui-user.bat手动编辑python和git路径,并且禁止使用虚拟环境(这也是webui官方支持的,市面上主流整合包例如秋叶、星空都是这个原理)

============================

问题依旧,经过排查,训练时调用的python和accelerate并不是虚拟环境或者指定python路径下的,而是系统本机的 而系统本机不一定有accelerate甚至python

理解了,我是直接从conda环境启动的,所以直接调用到了accelerate 现在环境1和环境2都不能work吗?

daxijiu commented 1 year ago

理解了,我是直接从conda环境启动的,所以直接调用到了accelerate 现在环境1和环境2都不能work吗?

都不行

bubbliiiing commented 1 year ago

理解了,我是直接从conda环境启动的,所以直接调用到了accelerate 现在环境1和环境2都不能work吗?

都不行

这有点头疼啊,我思考一下,Sorry

bubbliiiing commented 1 year ago

其实本质上应该是要调用当前运行的python环境的accelerate

daxijiu commented 1 year ago

是的~~~

bubbliiiing commented 1 year ago

从路径上讲,accelerate和python应该是放在同一个文件夹下的

daxijiu commented 1 year ago

从路径上讲,accelerate和python应该是放在同一个文件夹下的

python -m xxxxxx 就可以调用当前python的各种库, 比如python -m accelerate python -m pip install xxxxx 不过目前这个插件的实现有的地方似乎python调用也是本机

bubbliiiing commented 1 year ago

从路径上讲,accelerate和python应该是放在同一个文件夹下的

python -m xxxxxx 就可以调用当前python的各种库, 比如python -m accelerate python -m pip install xxxxx 不过目前这个插件的实现有的地方似乎python调用也是本机

学到了,我在搜怎么在程序中获得当前运行的python的文件是哪个

wuziheng commented 1 year ago

import sys python_executable_path = sys.executable print("系统Python解释器的路径:", python_executable_path)

daxijiu commented 1 year ago

webui定义了一个环境变量PYTHON 可以用%PYTHON%获取当前定义的python路径

bubbliiiing commented 1 year ago

image 尴尬了,感觉是不是直接把python换accelerate吧?

bubbliiiing commented 1 year ago

https://github.com/aigc-apps/sd-webui-EasyPhoto/pull/13 我提了一个issue,可以尝试一下吗?

daxijiu commented 1 year ago

13 我提了一个issue,可以尝试一下吗?

试了一下~~~报了个新的 D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\extensions\sd-webui-EasyPhoto\scripts\train_kohya/train_lora.pyTraceback (most recent call last): File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\site-packages\gradio\routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api result = await self.call_function( File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function prediction = await anyio.to_thread.run_sync( File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\site-packages\gradio\utils.py", line 707, in wrapper response = f(args, *kwargs) File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\extensions\sd-webui-EasyPhoto\scripts\easyphoto_train.py", line 189, in easyphoto_train_forward subprocess.run(command, check=True) File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\subprocess.py", line 503, in run with Popen(popenargs, **kwargs) as process: File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\subprocess.py", line 971, in init self._execute_child(args, executable, preexec_fn, close_fds, File "D:\kkkkk\release\orginal_sd_webui\stable-diffusion-webui\python\lib\subprocess.py", line 1456, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] 系统找不到指定的文件。

bubbliiiing commented 1 year ago

诶,是不是webui环境里面没有accelerate这个东西

daxijiu commented 1 year ago

诶,是不是webui环境里面没有accelerate这个东西

requirement里有的 image

pip list也能看到 image

daxijiu commented 1 year ago

虚拟环境 image

整合包 image

bubbliiiing commented 1 year ago

刚刚查阅半天accelerate的文档,发现他在代码里面的调用方式应该是这样,我在代码里做了更新,可麻烦你否再试一下? python -m accelerate.commands.launch --num_processes=2 {script_name.py} {--arg1} {--arg2}

daxijiu commented 1 year ago

刚刚查阅半天accelerate的文档,发现他在代码里面的调用方式应该是这样,我在代码里做了更新,可麻烦你否再试一下? python -m accelerate.commands.launch --num_processes=2 {script_name.py} {--arg1} {--arg2}

稍等~~我觉得在你#13的方法简单改一下应该是可行的,待会儿我两个测完了再更新

bubbliiiing commented 1 year ago

静候佳音

刚刚查阅半天accelerate的文档,发现他在代码里面的调用方式应该是这样,我在代码里做了更新,可麻烦你否再试一下? python -m accelerate.commands.launch --num_processes=2 {script_name.py} {--arg1} {--arg2}

稍等~~我觉得在你#13的方法简单改一下应该是可行的,待会儿我两个测完了再更新

daxijiu commented 1 year ago

静候佳音

刚刚查阅半天accelerate的文档,发现他在代码里面的调用方式应该是这样,我在代码里做了更新,可麻烦你否再试一下? python -m accelerate.commands.launch --num_processes=2 {script_name.py} {--arg1} {--arg2}

稍等~~我觉得在你#13的方法简单改一下应该是可行的,待会儿我两个测完了再更新

更新: 原来的#13改这一行后,仅在整合包(or python embeddable)上ok,但是在venv上报错 f'{os.path.join(os.path.dirname(python_executable_path), "Scripts//accelerate")}', 'launch', '--mixed_precision=fp16', "--main_process_port=3456", f'{train_kohya_path}', 原因是整合包python(比如python embeddable其他自定义embeddable),获取到的python目录是在环境的根目录(因为python.exe在根目录),而accelerate在Scripts文件夹里。python自己的venv python.exe和accelerate则都是在scripts文件夹里(根目录没有python.exe)。也就是说不能通过python的路径准确获得accelerate的路径(或者需要更多的判断)

现在的#13 f'{python_executable_path}', '-m', 'accelerate.commands.launch', '--mixed_precision=fp16', "--main_process_port=3456", f'{train_kohya_path}', 整合包和venv都ok了,看来官方文档的方法确实是靠谱的。

测试在win10,webui 1.6.0 torch 2.0.1+CU118 4090上完成,训练大概9min

bubbliiiing commented 1 year ago

静候佳音

刚刚查阅半天accelerate的文档,发现他在代码里面的调用方式应该是这样,我在代码里做了更新,可麻烦你否再试一下? python -m accelerate.commands.launch --num_processes=2 {script_name.py} {--arg1} {--arg2}

稍等~~我觉得在你#13的方法简单改一下应该是可行的,待会儿我两个测完了再更新

更新: 原来的#13改这一行后,仅在整合包(or python embeddable)上ok,但是在venv上报错 f'{os.path.join(os.path.dirname(python_executable_path), "Scripts//accelerate")}', 'launch', '--mixed_precision=fp16', "--main_process_port=3456", f'{train_kohya_path}', 原因是整合包python(比如python embeddable其他自定义embeddable),获取到的python目录是在环境的根目录(因为python.exe在根目录),而accelerate在Scripts文件夹里。python自己的venv python.exe和accelerate则都是在scripts文件夹里(根目录没有python.exe)。

现在的#13 f'{python_executable_path}', '-m', 'accelerate.commands.launch', '--mixed_precision=fp16', "--main_process_port=3456", f'{train_kohya_path}', 整合包和venv都ok了,看来官方文档的方法确实是靠谱的。

测试在win10,webui 1.6.0 torch 2.0.1+CU118 4090上完成,训练大概9min

那应该https://github.com/aigc-apps/sd-webui-EasyPhoto/pull/13就没有问题了,我merge到main,非常感谢你的帮助。

daxijiu commented 1 year ago

那应该https://github.com/aigc-apps/sd-webui-EasyPhoto/pull/13就没有问题了,我merge到main,非常感谢你的帮助。 好哦~~~~

daxijiu commented 1 year ago

fixed by https://github.com/aigc-apps/sd-webui-EasyPhoto/pull/13