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

ImportError: No module named pathlib #32

Closed
nerdprogrammergm opened this issue Dec 27, 2017 · 13 comments
Closed

ImportError: No module named pathlib #32

nerdprogrammergm opened this issue Dec 27, 2017 · 13 comments

Comments

@nerdprogrammergm
Copy link

nerdprogrammergm commented Dec 27, 2017

I have already installed pathlib in python3.6:Requirement already satisfied: pathlib in /usr/local/lib/python3.6/dist-packages

Command executed: python3 faceswap.py extract -i ~/faceswap/photo/trump -o ~/faceswap/data/trump

Traceback (most recent call last):
File "faceswap.py", line 3, in
from scripts.extract import ExtractTrainingData
File "/home/ubuntu/data/faceswap/scripts/extract.py", line 2, in
from lib.cli import DirectoryProcessor
File "/home/ubuntu/data/faceswap/lib/cli.py", line 6, in
from lib.utils import get_image_paths, get_folder, load_images, stack_images
File "/home/ubuntu/data/faceswap/lib/utils.py", line 4, in
from pathlib import Path
ImportError: No module named pathlib

Can anyone help me out with this issue?

@yangchen8710
Copy link
Contributor

use python3.6 instead of python3?

@Ganonmaster
Copy link
Contributor

Make sure you are running python 3.6 or otherwise try adding pathlib through pip:

pip install --upgrade pathlib

@Ganonmaster
Copy link
Contributor

Otherwise, try running the script in a virtualenv as described in the guide.

@nerdprogrammergm
Copy link
Author

nerdprogrammergm commented Dec 27, 2017

Thanks for quick reply.
I figured out the issue and now working on further part.
Presently I am getting this error:
Using TensorFlow backend.
usage: faceswap.py [-h] {extract,train,convert} ...
faceswap.py: error: invalid choice: 'extract/trump' (choose from 'extract', 'train', 'convert')

I have extracted the faces in extract/trump and extract/cage,
using this command to train the model: python3.6 faceswap.py -A extract/trump -B extract/cage -m models -p

What wrong am I doing?

@lukaville
Copy link
Contributor

lukaville commented Dec 27, 2017

Most likely you are trying to start the script with invalid arguments. You have to specify 'extract', 'train' or 'convert' right after faceswap.py

@nerdprogrammergm
Copy link
Author

I am following the instructions mentioned on this lnk:https://github.com/deepfakes/faceswap/blob/master/USAGE.md

which says to execute the following command to train the model!
python3.6 faceswap.py -A ~/faceswap/data/trump -B ~/faceswap/data/cage -m ~/faceswap/models/

@lukaville
Copy link
Contributor

Looks like it's a typo in the doc. Use python faceswap.py train -A ~/faceswap/data/trump -B ~/faceswap/data/cage -m ~/faceswap/models/ instead.

@nerdprogrammergm
Copy link
Author

Got the issue, its the "train" missed out from the command!
This command should be used to train the model: python3.6 faceswap.py train -A extract/trump -B extract/cage -m models -p
@lukaville @yangchen8710 @Ganonmaster

@nerdprogrammergm
Copy link
Author

Yes, thanks man. Have you tried to setup this on aws ec2 p2 instance?
Overthere, I am dealing with the issue for cuda9, got to wait until tensorflow support cuda9.
For cuda8, I tried but somewhere dlib through error about lib related to 9.so . Try to troubleshoot it but found that its tensorflow which is not compatible with cuda9 yet :/
You got any solution for this?

@nerdprogrammergm
Copy link
Author

nerdprogrammergm commented Dec 27, 2017

There is also a typo in the doc for converting:
Using TensorFlow backend.
usage: faceswap.py [-h] {extract,train,convert} ...
faceswap.py: error: invalid choice: 'data/trump' (choose from 'extract', 'train', 'convert')

Proper command to convert is: python3.6 faceswap.py convert -i data/trump -o output/trump -m models

@Ganonmaster @yangchen8710

Sorry for tagging ya all, m noob at using github too!

@lukaville
Copy link
Contributor

@nerdprogrammergm I successfully used floydhub, I made a post about it https://www.reddit.com/r/deepfakes/comments/7mgpki/floydhub_cloud_training/

@nerdprogrammergm
Copy link
Author

Cool @lukaville , great job.
Will give it a try ;)
In the mean time can you have a look on this link and help me out?
deepfakes/faceswap-playground#10
Thanks once again.

@Ganonmaster
Copy link
Contributor

The doc changes have been merged. I'll look at your other issue shortly. 👍

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

4 participants