You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I altered some code to fit my computer, these are the alters.
When the code loads the training data and test data in (X_train, y_train), (X_test, y_test) = mnist.load_data(), an error happens saying
Using Theano backend.
Traceback (most recent call last):
File "mnist_spiking_cnn.py", line 34, in<module>
(X_train, y_train), (X_test, y_test) = mnist.load_data()
ValueError: too many values to unpack
So, I scanned the code of keras, finding that the load_data function returns a tuple and I can only get data in this way:
data=mnist.load_data()
X_train=data[0][0] # shape is (50000. 768)y_train=data[0][1] # shape is (50000,)X_test=data[1][0] # shape is (10000, 768)y_test=data[1][1] # shape is (10000,)
Besides, I use the cpu instead of gpu by changing os.environ['THEANO_FLAGS'] = 'device=cpu,floatX=float32'.
My keras version is 1.2.0. I think the example code use a different version of keras, but I don't think the way I load data in makes this code perform bad.
So, can you give me some advice on how to tune the code?
The text was updated successfully, but these errors were encountered:
Yeah, there's definitely some problem in the optimization there.
Keras is changing all the time, so it's hard to know what the problem is with any particular version. I'd go look at Keras forums and try to figure out how to train a good MNIST net just using Keras. Then you can worry about making it spiking using the code here.
I ran the code of
examples/keras/mnist_spiking_cnn.py
and get a bad result. This is the final output:I altered some code to fit my computer, these are the alters.
When the code loads the training data and test data in
(X_train, y_train), (X_test, y_test) = mnist.load_data()
, an error happens sayingSo, I scanned the code of keras, finding that the
load_data
function returns a tuple and I can only get data in this way:Besides, I use the cpu instead of gpu by changing
os.environ['THEANO_FLAGS'] = 'device=cpu,floatX=float32'
.My keras version is
1.2.0
. I think the example code use a different version of keras, but I don't think the way I load data in makes this code perform bad.So, can you give me some advice on how to tune the code?
The text was updated successfully, but these errors were encountered: