Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

keras

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.

like image 993
Pragyaditya Das Avatar asked Dec 10 '22 14:12

Pragyaditya Das


1 Answers

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

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

like image 193
John Gordon Avatar answered Jan 18 '23 16:01

John Gordon