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.24k stars 485 forks source link

ImportError: cannot import name 'Progbar' from 'keras.utils', pip cannot install v1.0.4 #172

Open PorcelainMouse opened 2 years ago

PorcelainMouse commented 2 years ago

When I run pip3 install --user fawkes and then fawkes -d . --mode=low, I get this error:

module 'keras.preprocessing.image' has no attribute 'img_to_array'

I looked up that error and it seemed like TF 2.10 might be too new. So I downgraded it to 2.8. Now, I get:

ImportError: cannot import name 'Progbar' from 'keras.utils'

Previous issue #148 references requirements.txt file, but I cannot find it.

Also, there aren't any older versions of keras & tenserflow in pipy than 2.8. So, I'm not sure what version of keras could be the recommended one. I don't think the instructions are right; pip install doesn't produce a usable configuration. It installed fawkes version 1.0.3.

When I try to upgrade fawkes to v1.0.4, pip complains that it requires Python < 3.8 and TF == 2.4.1. I'm not sure how to get these easily. Manually install everything?

I used fawkes about a year ago and it worked fine. Guessing it was Python3.8?

PorcelainMouse commented 2 years ago

I was able to get fawkes to install and work after considerable effort and pain. I had to build python 3.7.15 from source, and then install it system-wide (it cannot be install for just one user). Then, I created a virtualenv for working with that version of python. Then I had to upgrade pip and setuptools in my venv; the default ones installed by virtualenv wouldn't install some dependencies correctly (wrapt?). Then I installed fawkes==1.0.4 with pip, which was able to find the correct versions of keras, TF, and other modules and install them.