1

I got an while importing resnet.

I tried removed latest version and install old version of keras==1.0.6 and it doesn't work. Also i did changes in resnet.py --> "from keras_applications.imagenet_utils import _obtain_input_shape , i got an error an like "ImportError: cannot import name 'GlobalMaxPooling2D' "

from keras.applications.imagenet_utils import _obtain_input_shape
import os
import numpy as np
from pickle import dump
import resnet
import numpy as np
from keras.preprocessing.image import load_img, img_to_array
from keras.models import Model
from os import listdir
import cv2
from keras import applications

I need import all these without an error. kindly help me to sort this. Thanks in advance

jeevitha
  • 11
  • 6
  • Possible duplicate of [ImportError: cannot import name '\_obtain\_input\_shape' from keras](https://stackoverflow.com/questions/49113140/importerror-cannot-import-name-obtain-input-shape-from-keras) – Vadim Feb 11 '19 at 12:57

1 Answers1

0

Change

from keras.applications.imagenet_utils import _obtain_input_shape

with

from keras_applications.imagenet_utils import _obtain_input_shape
WEN WEN
  • 126
  • 2
  • 10
  • yes , when i changed it as from keras_applications.imagenet_utils import _obtain_input_shape i got an error like ImportError: cannot import name 'GlobalMaxPooling2D' its keras.layers – jeevitha Feb 12 '19 at 07:48