rcmalli / keras-vggface

VGGFace implementation with Keras Framework
MIT License
928 stars 417 forks source link

Example code errors out #21

Closed akrishnamo closed 6 years ago

akrishnamo commented 6 years ago
keras.__version__, tf.__version__
('2.0.5', '1.3.0')
import numpy as np
from keras.preprocessing import image
from keras_vggface.vggface import VGGFace
from keras_vggface import utils
from keras.layers import Flatten, Dense, Input

# tensorflow
model = VGGFace()

error dump

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-58-e1aca8cf44e3> in <module>()
      6 
      7 # tensorflow
----> 8 model = VGGFace()

/opt/conda/lib/python3.6/site-packages/keras_vggface/vggface.py in VGGFace(include_top, weights, input_tensor, input_shape, pooling, classes)
     79                                       min_size=48,
     80                                       data_format=K.image_data_format(),
---> 81                                       require_flatten=include_top)
     82 
     83     if input_tensor is None:

TypeError: _obtain_input_shape() got an unexpected keyword argument 'require_flatten'
jandremarais commented 6 years ago

I think you should change the require_flatten=include_top to include_top=include_top in the _obtain_input_shape() function of the vggface.py file. I suspect it's something to do with version differences.

rcmalli commented 6 years ago

It is working as expected since version 0.4. You may need to update the keras_vggface library. Each release is being tested with Travis.