Skip to content

Commit

Permalink
Final setup.py changes
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Nov 17, 2018
1 parent cf98c0b commit c08e45b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
1 change: 1 addition & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ If you have issues/errors follow the Manual install steps below.
If dlib failed to install you can follow the steps to [manually install dlib](#dlib).\
Once dlib is installed follow these steps:

- Install tkinter (required for the GUI) by typing: `conda install tk`
- Install requirements: `pip install -r requirements.txt`
- Install Tensorflow (either GPU or CPU version depending on your setup):
- GPU Version: `pip install tensorflow-gpu`
Expand Down
51 changes: 29 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,29 +455,34 @@ def update_tf_dep(cpu_only):
cudnn_req[1] >= cudnn_inst[1]):
tf_ver = key
break
if not tf_ver:
out_warning("Tensorflow currently has no official prebuild for your CUDA, cuDNN "
"combination.\nEither install a combination that Tensorflow supports or "
"build and install your own tensorflow-gpu.\r\n"
"CUDA Version: {}\r\n"
"cuDNN Version: {}\r\n"
"Help:\n"
"Building Tensorflow: https://www.tensorflow.org/install/install_sources\r\n"
"Tensorflow supported versions: "
"https://www.tensorflow.org/install/source#tested_build_configurations".format(
CUDA_VERSION, CUDNN_VERSION))

custom_tf = input("Location of custom tensorflow-gpu wheel (leave "
"blank to manually install): ")
if custom_tf and not os.path.isfile(custom_tf):
out_error("{} not found".format(custom_tf))
return
if custom_tf:
REQUIRED_PACKAGES.append(custom_tf)
if tf_ver:
tf_ver = "tensorflow-gpu=={}.0".format(tf_ver)
REQUIRED_PACKAGES.append(tf_ver)
return

tf_ver = "tensorflow-gpu=={}.0".format(tf_ver)
REQUIRED_PACKAGES.append(tf_ver)
out_warning("Tensorflow currently has no official prebuild for your CUDA, cuDNN "
"combination.\nEither install a combination that Tensorflow supports or "
"build and install your own tensorflow-gpu.\r\n"
"CUDA Version: {}\r\n"
"cuDNN Version: {}\r\n"
"Help:\n"
"Building Tensorflow: https://www.tensorflow.org/install/install_sources\r\n"
"Tensorflow supported versions: "
"https://www.tensorflow.org/install/source#tested_build_configurations".format(
CUDA_VERSION, CUDNN_VERSION))

custom_tf = input("Location of custom tensorflow-gpu wheel (leave "
"blank to manually install): ")
if not custom_tf:
return

custom_tf = os.path.realpath(os.path.expanduser(custom_tf))
if not os.path.isfile(custom_tf):
out_error("{} not found".format(custom_tf))
elif os.path.splitext(custom_tf)[1] != ".whl":
out_error("{} is not a valid pip wheel".format(custom_tf))
elif custom_tf:
REQUIRED_PACKAGES.append(custom_tf)


def install_missing_dep():
Expand Down Expand Up @@ -690,7 +695,9 @@ def main():
check_missing_dep()
check_dlib()
install_missing_dep()
out_info("All python3 dependencies are met.\r\nYou are good to go.")
out_info("All python3 dependencies are met.\r\nYou are good to go.\r\n\r\n"
"Enter: 'python faceswap.py -h' to see the options\r\n"
" 'python faceswap.py gui' to launch the GUI")


if __name__ == "__main__":
Expand Down

0 comments on commit c08e45b

Please sign in to comment.