Error while running VGG16_AVG


(Naman) #1

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!!


(Chan Sooi Loong) #2

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.


(Naman) #3

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!


#4

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.


(Naman) #5

Thank you lessec. Appreciate your help!


(Stephan Rasp) #6

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!