Pragyaditya Das Pragyaditya Das - 1 year ago 183
Python Question

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.

Answer Source

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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download