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
api is not support tensorflow version 2.2+ #143
Comments
this is an environmental issue. unit tests were run in tf 1.9.0. you might downgrade your tf version to handle this issue. |
This could easily be handled with "import tf.compat.v1 as tf", ofc needs to be applied to module level. |
@KiLJ4EdeN you mean this import should be done in deepface or out of deepface? |
Sadly needs to be done for the whole module (deepface) where tf 1.x stuff are imported, Might be worth trying on a separate branch though, since many install the latest tf version by default. |
it seems that downgrade is easier :) |
could you downgrade other dependencies as mentioned. if it says keras>=2.2.0 then, downgrade keras to 2.2.0 (pip install keras==2.2.0). |
I fixed this issue. deepface will be compatible with tf 2. I plan to release it tomorrow. |
this is solved in 0.0.46 release right now. |
@serengil still the same issue
it giving the following error on TensorFlow version 2.3.1
|
@shrhawk-entertainer you are using the latest version of deepface - 0.0.49? Because, as you can see here - 86th line, graph = tf.get_default_graph() code is not running for tensorflow 2. |
@serengil yes I am using version 0.0.49 and the code you mentioned above is for API but I am invoking the deepface from the python shell
the traceback error is
|
could you share the all log here. I could not understand where this error come from. Which line of the deepface.py. |
here's the complete log
|
Oke I think I understood. MTCNN requires Keras dependency. I am using tensorflow 2.3.1 and keras 2.4.3. You can either install keras with the command "pip install keras" Or you can change the face detector backend as shown below
|
@serengil Keras is already installed with version 2.2.4 |
as I mentioned, you cannot import MTCNN that's the problem. I can import it with tf 2.3.1 and keras 2.4.3. Upgrading keras to 2.4.3 might solve this but you should try. You might open an issue to mtcnn repo directly here. I recommend you to use opencv backend as a workaround. |
api.py not support tensorflow version 2.2.0+, when i run it, report error function get_default_graph not found, and it's can't load some models, report ValueError: rate must be a scalar tensor or a float in the range [0, 1)
The text was updated successfully, but these errors were encountered: