简体   繁体   中英

Dense layer using Keras with Theano

I am starting a simple tutorial in keras. The full code I am using is at the end of this website:

https://elitedatascience.com/keras-tutorial-deep-learning-in-python

I am getting this error:

ValueError: ('The specified size contains a dimension with value <= 0', (-768, 128))

for the lines where Dense appears:

model.add(Dense(128, activation='relu'))

and

model.add(Dense(10, activation='softmax'))

I am using this json file for the backend configuration:

{
"image_dim_ordering": "tf",
"epsilon": 1e-07, 
"floatx": "float32", 
"backend": "theano"
}

Any idea on what is the problem? I am using python2.7 and the MNIST database seems to be right since I was able to plot the images and also to see the labels with no problem.

Best,

Ángel.

尝试将"image_dim_ordering": "tf""image_dim_ordering": "th" ,因为您使用Theano作为后端。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM