Search code examples
pythonkeras

from keras.layers import Dense -- cannot import name 'Dense'


I am trying to play around with Keras a little.

When I try the following code :

from keras.layers import Dense

I get the following error:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    from keras.layers import Dense
ImportError: cannot import name 'Dense'

I am using Python 3.4.3, I am on a Windows 8 64 bit machine.

Thank you.


Solution

  • The error is telling you that it found nothing named Dense in that module.

    Perhaps you meant from keras.layers.core import Dense?