Tensorflow version check

This commit is contained in:
torzdf
2019-02-28 10:53:00 +00:00
parent a11bfe8588
commit 1f8da1d784
4 changed files with 27 additions and 9 deletions

View File

@@ -77,7 +77,7 @@ The developers are also not responsible for any damage you might cause to your o
- [brew](https://brew.sh/) install python3 (macOS)
- [virtualenv](https://github.com/pypa/virtualenv) and [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io) may help when you are not using docker.
- If you are using an Nvidia graphics card You should install CUDA (https://developer.nvidia.com/cuda-zone) and CUDNN (https://developer.nvidia.com/cudnn). If you do not plan to build Tensorflow yourself, make sure you install no higher than version 9.0 of CUDA and 7.0.x of CUDNN
- If you are using an Nvidia graphics card You should install CUDA (https://developer.nvidia.com/cuda-zone) and CUDNN (https://developer.nvidia.com/cudnn). If you do not plan to build Tensorflow yourself, make sure you install no higher than version 10.0 of CUDA and 7.4.x of CUDNN
- dlib is required for face recognition and is compiled as part of the setup process. You will need the following applications for your os to successfully install dlib (nb: list may be incomplete. Please raise an issue if another prerequisite is required for your OS):
- Windows: Visual Studio 2015, CMake v3.8.2
- Linux: build-essential, cmake
@@ -224,7 +224,7 @@ On the install screen:
### Cuda
**GPU Only** If you do not have an Nvidia GPU you can skip this step.
At the time of writing Tensorflow (version 1.12) only supports Cuda up to version 9.0, but check https://www.tensorflow.org/install/gpu for the latest supported version. It is crucial that you download the correct version of Cuda.
At the time of writing Tensorflow (version 1.13.1) only supports Cuda up to version 10.0, but check https://www.tensorflow.org/install/gpu for the latest supported version. It is crucial that you download the correct version of Cuda.
Download and install the correct version of the Cuda Toolkit from: https://developer.nvidia.com/cuda-toolkit-archive
@@ -233,7 +233,7 @@ NB: Make a note of the install folder as you'll need to access it in the next st
### cuDNN
**GPU Only** If you do not have an Nvidia GPU you can skip this step.
As with Cuda you will need to install the correct version of cuDNN that the latest Tensorflow supports. At the time of writing this is Tensorflow v1.12 which supports cuDNN version 7.2, but check https://www.tensorflow.org/install/gpu for the latest supported version.
As with Cuda you will need to install the correct version of cuDNN that the latest Tensorflow supports. At the time of writing this is Tensorflow v1.13.1 which supports cuDNN version 7.4, but check https://www.tensorflow.org/install/gpu for the latest supported version.
Download cuDNN from https://developer.nvidia.com/cudnn. You will need to create an account with Nvidia.

View File

@@ -27,6 +27,7 @@ class ScriptExecutor():
def import_script(self):
""" Only import a script's modules when running that script."""
self.test_for_tf_version()
self.test_for_gui()
cmd = os.path.basename(sys.argv[0])
src = "tools" if cmd == "tools.py" else "scripts"
@@ -35,6 +36,22 @@ class ScriptExecutor():
script = getattr(module, self.command.title())
return script
@staticmethod
def test_for_tf_version():
""" Check that the minimum required Tensorflow version is installed """
min_ver = 1.12
try:
import tensorflow as tf
except ImportError:
logger.error("Tensorflow is a requirement but is not installed on your system.")
exit(1)
tf_ver = float(".".join(tf.__version__.split(".")[:2]))
if tf_ver < min_ver:
logger.error("The minimum supported Tensorflow is version %s but you have version "
"%s installed. Please upgrade Tensorflow.", min_ver, tf_ver)
exit(1)
logger.debug("Installed Tensorflow Version: %s", tf_ver)
def test_for_gui(self):
""" If running the gui, check the prerequisites """
if self.command != "gui":

View File

@@ -16,7 +16,9 @@ face-recognition
# tensorflow is included within the docker image.
# If you are looking for dependencies for a manual install,
# you may want to install tensorflow-gpu==1.4.0 for CUDA 8.0,
# or 1.6.0<=tensorflow-gpu<=1.13.0 for CUDA 9.0
# NB: Tensorflow version 1.12 is the minimum supported version of Tensorflow.
# If your graphics card support is below Cuda 9.0 you will need to either
# compile tensorflow yourself or download a custom version.
# Install 1.12.0<=tensorflow-gpu<=1.13.0 for CUDA 9.0
# or tensorflow-gpu>=1.13.1 or tf-nightly-gpu for CUDA 10.0
# NB: MTCNN will not work with tensorflow releases prior to 1.6.0

View File

@@ -13,9 +13,7 @@ from subprocess import CalledProcessError, run, PIPE, Popen
INSTALL_FAILED = False
# Revisions of tensorflow-gpu and cuda/cudnn requirements
TENSORFLOW_REQUIREMENTS = {"==1.2.0": ["8.0", "5.1"],
"==1.4.0": ["8.0", "6.0"],
"==1.12.0": ["9.0", "7.2"],
TENSORFLOW_REQUIREMENTS = {"==1.12.0": ["9.0", "7.2"],
">=1.13.1": ["10.0", "7.4"]}
@@ -227,6 +225,7 @@ class Environment():
return
self.output.warning(
"The minimum Tensorflow requirement is 1.12. \n"
"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"