YuvalNirkin / fsgan

FSGAN - Official PyTorch Implementation
https://nirkin.com/fsgan
Creative Commons Zero v1.0 Universal
749 stars 147 forks source link

No such file or directory: 'weights/WIDERFace_DSFD_RES152.pth' #163

Open BCL123456-BAL opened 1 year ago

BCL123456-BAL commented 1 year ago

issue:FileNotFoundError: [Errno 2] No such file or directory: 'weights/WIDERFace_DSFD_RES152.pth' issue reappearance:

  1. clone repository to D:/Dsktop (finally path :D:\Desktop\fsgan)
  2. cd fsgan ,then conda env create -f fsgan_env.yml (since ffmpeg =4.4.1 is not exist, i load ffmpeg 4.4.2)
  3. conda activate fsgan
  4. add the root directory of the repository to PYTHONPATH. ( variable name:PYTHONPATH , variable value:D:\Desktop\fsgan)
  5. place ''download_fsgan_models.py'' in repository(D:\Desktop\fsgan) and run ''python download_fsgan_models.py'' ,succssfully load weight in repository, finally result as follow: image
  6. read ''Face Swapping Inference'' ,then run ''cd fsgan/inference'' ,''python swap.py ../docs/examples/shinzo_abe.mp4 -t ../docs/examples/conan_obrien.mp4 -o . --finetune --finetune_save --seg_remove_mouth'', finally return the issue:''FileNotFoundError: [Errno 2] No such file or directory: 'weights/WIDERFace_DSFD_RES152.pth''
  7. However 'weights/WIDERFace_DSFD_RES152.pth' already exist in weight file, proving as follow: wight I'm confused about this。
YuvalNirkin commented 1 year ago

Please try the following command:

# From FSGAN's root directory
python fsgan/inference/swap.py docs/examples/shinzo_abe.mp4 -t docs/examples/conan_obrien.mp4 -o . --finetune --finetune_save --seg_remove_mouth
BCL123456-BAL commented 1 year ago

unfortunately, it still has a issue, as follow:

就是那个男人 @.***

 

------------------ 原始邮件 ------------------ 发件人: "YuvalNirkin/fsgan" @.>; 发送时间: 2022年11月20日(星期天) 中午1:39 @.>; @.**@.>; 主题: Re: [YuvalNirkin/fsgan] No such file or directory: 'weights/WIDERFace_DSFD_RES152.pth' (Issue #163)

Please try the following command:

From FSGAN's root directory python fsgan/inference/swap.py docs/examples/shinzo_abe.mp4 -t docs/examples/conan_obrien.mp4 -o . --finetune --finetune_save --seg_remove_mouth

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

YuvalNirkin commented 1 year ago

Please write the full error.

BCL123456-BAL commented 1 year ago

就是那个男人 @.***

 

------------------ 原始邮件 ------------------ 发件人: "YuvalNirkin/fsgan" @.>; 发送时间: 2022年11月20日(星期天) 中午1:52 @.>; @.**@.>; 主题: Re: [YuvalNirkin/fsgan] No such file or directory: 'weights/WIDERFace_DSFD_RES152.pth' (Issue #163)

Please write the full error.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

BCL123456-BAL commented 1 year ago

sorry,I went to class before, useing mobile phone qq mailbox reply to the message.The image may be not loaded by qq emil The fully error as follow:

  1. l back FSGAN's root directory and run you command: ''python fsgan/inference/swap.py docs/examples/shinzo_abe.mp4 -t docs/examples/conan_obrien.mp4 -o . --finetune --finetune_save --seg_remove_mouth''
  2. pycharm throw the error :'' _pickle.UnpicklingError: invalid load key, '<'. ''
  3. The whole image as follow: image
YuvalNirkin commented 1 year ago

Seems like the models were not downloaded correctly. The files should be 100MB+. Try to download them again. If the script is not working, use the links directly.

BCL123456-BAL commented 1 year ago

I sincerely appreciate your guidance, I have solved this issue. Here is my solving process,, in the hope that it will help others who are just as confused as I am,

  1. If there is a error ,'' _pickle.UnpicklingError: invalid load key, '<'. '' or '''weights/WIDERFace_DSFD_RES152.pth''', after reload the model.
  2. check your 'wight ' file,. If it just 3kb , open the file ''download_fsgan_models.py''. load the fils by corresponding urls.