modelscope / facechain

FaceChain is a deep-learning toolchain for generating your Digital-Twin.
Apache License 2.0
9.15k stars 856 forks source link

合成图片报错 local variable 'checkpoint' referenced before assignment #548

Closed xianyuanjiaruo closed 5 months ago

xianyuanjiaruo commented 6 months ago

模型能够训练成功,但是在合成风格化图片时失败。 检查了merge_lora代码,加了个global,也不行。 error.txt

conda窗口没有与前端的交互信息,我怀疑是前端gradio导致的bug,checkpoint都没有加载出来就超时了,没有赋值给merge_lora.py 有谁遇到类似问题吗? 提示:UnboundLocalError: local variable 'checkpoint' referenced before assignment

Lora Path: C:\Users\Administrator.cache\modelscope\hub\YorickHe\polaroid_lora\InstantPhotoX3.safetensors

Lora Path: F:\AI\facechain-main\worker_data\qw\ly261666/cv_portrait_model\shijie1 concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "D:\Python\Anaconda\envs\facechain\lib\concurrent\futures\process.py", line 243, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) File "F:\AI\facechain-main\facechain\inference.py", line 559, in call gen_results = main_model_inference(self.pose_model_path, self.pose_image, self.use_depth_control, File "F:\AI\facechain-main\facechain\inference.py", line 438, in main_model_inference return main_diffusion_inference(pos_prompt, neg_prompt, input_img_dir, base_model_path, File "F:\AI\facechain-main\facechain\inference.py", line 195, in main_diffusion_inference pipe = merge_lora(pipe, lora_human_path, multiplier_human, from_safetensor=lora_human_path.endswith('safetensors'), device='cuda') File "F:\AI\facechain-main\facechain\merge_lora.py", line 33, in merge_lora for idx, key in enumerate(checkpoint): UnboundLocalError: local variable 'checkpoint' referenced before assignment

image

sunbaigui commented 5 months ago

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

xianyuanjiaruo commented 4 months ago

已经解决了,重写了这一段代码,加了声明,好了