GithubHelp home page GithubHelp logo

resnet's Issues

cannot import name '_obtain_input_shape'

When using more current keras versions like 2.2.2 keras.applications.imagenet_utils can not be found because it has been moved to keras_applications.imagenet_utils

Traceback (most recent call last):
  File "example.py", line 1, in <module>
    import resnet
  File "/usr/local/lib/python3.6/site-packages/resnet-0.1-py3.6.egg/resnet/__init__.py", line 2, in <module>
    from .resnet152 import ResNet152
  File "/usr/local/lib/python3.6/site-packages/resnet-0.1-py3.6.egg/resnet/resnet152.py", line 27, in <module>
    from keras.applications.imagenet_utils import _obtain_input_shape
ImportError: cannot import name '_obtain_input_shape'

ValueError: Input 0 is incompatible with layer flatten_2: expected min_ndim=3, found ndim=2

Total memory: 7.92GiB
Free memory: 7.28GiB
2017-12-07 14:19:22.480859: I tensorflow/core/common_runtime/gpu/gpu_device.cc:976] DMA: 0
2017-12-07 14:19:22.480867: I tensorflow/core/common_runtime/gpu/gpu_device.cc:986] 0: Y
2017-12-07 14:19:22.480876: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1045] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:02:00.0)
Model loaded.
Traceback (most recent call last):
File "finetune_inceptionv3.py", line 38, in
top_model.add(Flatten(input_shape=base_model.output_shape[1:]))
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 464, in add
layer(x)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 559, in call
self.assert_input_compatibility(inputs)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 474, in assert_input_compatibility
str(K.ndim(x)))
ValueError: Input 0 is incompatible with layer flatten_2: expected min_ndim=3, found ndim=2

what problem happen?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.