Shawn-Shan / fawkes

Fawkes, privacy preserving tool against facial recognition systems. More info at https://sandlab.cs.uchicago.edu/fawkes
https://sandlab.cs.uchicago.edu/fawkes
BSD 3-Clause "New" or "Revised" License
5.22k stars 481 forks source link

fawkes fails due to AttributeError #140

Closed Pik-9 closed 3 years ago

Pik-9 commented 3 years ago

I cannot run fawkes on my Linux machine after installing it pip3.

Steps to reproduce

# Create a virtual environment just for fawkes
python3 -m venv fawkes-env
# Activate it
source fawkes-env/bin/activate
# Install fawkes from PypI
pip3 install fawkes
# Run it
fawkes

The error message is

2021-07-03 20:04:41.374867: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-07-03 20:04:41.374893: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "/mnt/Daten/tmp/python/face/fawkes-env/bin/fawkes", line 5, in <module>
    from fawkes import main
  File "/mnt/Daten/tmp/python/face/fawkes-env/lib/python3.9/site-packages/fawkes/__init__.py", line 9, in <module>
    from .differentiator import FawkesMaskGeneration
  File "/mnt/Daten/tmp/python/face/fawkes-env/lib/python3.9/site-packages/fawkes/differentiator.py", line 11, in <module>
    from fawkes.utils import preprocess, reverse_preprocess
  File "/mnt/Daten/tmp/python/face/fawkes-env/lib/python3.9/site-packages/fawkes/utils.py", line 24, in <module>
    from keras.utils import Progbar
  File "/mnt/Daten/tmp/python/face/fawkes-env/lib/python3.9/site-packages/keras/__init__.py", line 20, in <module>
    from . import initializers
  File "/mnt/Daten/tmp/python/face/fawkes-env/lib/python3.9/site-packages/keras/initializers/__init__.py", line 124, in <module>
    populate_deserializable_objects()
  File "/mnt/Daten/tmp/python/face/fawkes-env/lib/python3.9/site-packages/keras/initializers/__init__.py", line 82, in populate_deserializable_objects
    generic_utils.populate_dict_with_module_objects(
AttributeError: module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'

I did some research and it seems to be an issue with keras. However since fawkes is just installed as a python package there is nothing the user can do about it. A workaround needs to be implemented in fawkes.

Thank you for your work and kind regards, 🂩

Shawn-Shan commented 3 years ago

What is your TF version? Please use tensorflow==2.4.1.