Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BCL123456-BAL opened this issue Nov 20, 2022 · 7 comments
Open

Comments

@BCL123456-BAL
Copy link

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
Copy link
Owner

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
Copy link
Author

BCL123456-BAL commented Nov 20, 2022 via email

@YuvalNirkin
Copy link
Owner

Please write the full error.

@BCL123456-BAL
Copy link
Author

BCL123456-BAL commented Nov 20, 2022 via email

@BCL123456-BAL
Copy link
Author

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
Copy link
Owner

YuvalNirkin commented Nov 20, 2022

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants