Closed dalvarezdc closed 3 years ago
downgrade your tf to 2.2.0
Hello @serengil .
After downgrading I got the following error:
AttributeError: module 'tensorflow.compat.v2' has no attribute '__internal__'
Not to dig this up again, but for anyone interested, the fix for this is simple when using the latest tensorflow (2.5.0). Simply edit the mtcnn/network/network.py
file, which will appear in the error message, e.g.,
/home/davedgd/.pyenv/versions/3.9.5/lib/python3.9/site-packages/mtcnn/mtcnn.py
Specifically, edit the following lines to add tensorflow. to the keras imports:
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, PReLU, Flatten, Softmax
from keras.models import Model
Specifically, these should be:
from tensorflow.keras.layers import Input, Dense, Conv2D, MaxPooling2D, PReLU, Flatten, Softmax
from tensorflow.keras.models import Model
Once this change is made, everything should work!
Note that these fixes are already up on the official mtcnn repo. The issue is that the pip package is out of date and does not include these fixes, but I expect Google colab is using a source version, since it works fine with tensorflow 2.5.0 as @dpresident pointed out.
Hello! I am using DeepFace to analyze/classify some face images
The process is simple, I download an image into a folder and then I analyze it using DeepFace.analyze
This process gives me an AttributeError
*** AttributeError: module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'
This are my tensorflow packages installed:
tensorboard==2.5.0 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.0 tensorflow==2.5.0 tensorflow-estimator==2.5.0