Skip to content
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

Fix Attribute Error with Keras 'img_to_array' in Keras 2.9.0 #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fawkes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from PIL import Image, ExifTags
from keras.layers import Dense, Activation
from keras.models import Model
from keras.preprocessing import image
from keras.utils import image_utils as image

from fawkes.align_face import align
from six.moves.urllib.request import urlopen
Expand Down Expand Up @@ -263,7 +263,7 @@ def load_victim_model(number_classes, teacher_model=None, end2end=False):

def resize(img, sz):
assert np.min(img) >= 0 and np.max(img) <= 255.0
from keras.preprocessing import image
from keras.utils import image_utils as image
im_data = image.array_to_img(img).resize((sz[1], sz[0]))
im_data = image.img_to_array(im_data)
return im_data
Expand Down