Error while running VGG16_AVG

Hi,

I am getting error while running:

model = VGG16_Avg(include_top=False)

Error:

TypeError Traceback (most recent call last)
in ()
----> 1 model = VGG16_Avg(include_top=False)

~/nbs/vgg16_avg.py in VGG16_Avg(include_top, weights, input_tensor, input_shape, classes)
36 min_size=48,
37 data_format=K.image_data_format(),
—> 38 include_top=include_top)
39
40 if input_tensor is None:

TypeError: _obtain_input_shape() got an unexpected keyword argument ‘include_top’

Please help!!

Which keras version are you using?
pip install keras==2.0.3

I was having the same issue when i was using 2.0.8.

I used pip install Keras. So i guess it installs whatever the latest version is…

So should i use the command pip install keras==2.0.3 to install the 2.0.3 version?

Thanks for help!

Yes you can use

pip install keras == 2.0.3

and that will uninstall 2.0.8 and reinstall 2.0.3.

Will probably be easier to use whatever version of Keras they are using in the lesson.

Thank you lessec. Appreciate your help!

Just ran into this issue myself, but didn’t want to change my keras version.

The argument include_top in keras.applications.imagenet._obtain_input_shape has been renamed to require_flatten. Fixing this in line 38 of vgg16_avg.py should work!