adamcasson / resnet152

Adaptation of ResNet-152 to match Keras API with added large input option

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: _obtain_input_shape() got an unexpected keyword argument 'include_top'

alyato opened this issue · comments

@adamcasson when i call the resnet152, it show that
base_model = ResNet152(classes=8)

change line 262 - 266 to:

input_shape = _obtain_input_shape(input_shape,
                                  default_size=img_size,
                                  min_size=197,
                                  data_format=K.image_data_format(),
                                  require_flatten=False)

Fixed it for me at least

commented

Using TensorFlow backend.
Traceback (most recent call last):

File "", line 4, in
from resnet152 import ResNet152

File "resnet152.py", line 37, in
from keras.applications.imagenet_utils import _obtain_input_shape

ImportError: cannot import name _obtain_input_shape

commented

what @ChristofHenkel said didn't fix the issue for me

commented

switching from keras 2.2.2 to 2.0.0 didn't solve the issue for me

commented

the initial code in this repo with tensorflow 2.0.0 works though. It is better to consider a downgrade on this case

My PR #2 fixes that issue.

Merged PR from @edumucelli should fix