naman
(Naman)
August 29, 2017, 2:58am
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!!
jakcycsl
(Chan Sooi Loong)
August 29, 2017, 2:20pm
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
(Naman)
August 29, 2017, 2:26pm
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!
leesec
August 29, 2017, 2:30pm
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
(Naman)
August 29, 2017, 2:32pm
5
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!