Closed mantier closed 3 years ago
Hi I have dealt with similar issues before. Perhaps check the encoding of the saved Y label datasets (that SNN-TB uses in evaluation). I think one might be in categorical form [1, 29] while the other might be a single label.
Agree with @keeperbitz, the y labels should be saved in categorical form.
Please close issue if resolved.
Thanks a lot for your help! I was able to change the data to categorical form by more closely following the provided example.
Necessary steps:
tf.keras.utils.to_categorical()
model.compile()
function, change loss='sparse_categorical_crossentropy'
to loss='categorical_crossentropy'
. sparse_categorical_crossentropy expects single labels wheras categorical_crossentropy expects categorical data. Issue closed. SNN-TB expects categorical data.
Does this issue have to do with the way the test data labels are stored and the number of output neurons ? I have the same issue with the hand written digits of the MNIST dataset. My ANN has 10 output neurons and I have saved the test data using numpy.savez("y_test",y_test ) where y_test is the categorical representation (one hot encoded). The error is the same with the dimensions (1,29) being (1,10) now. Does anyone know how to fix this issue?
Could you double-check that y_test has the expected shape, i.e. (num_samples, 10) when you save it? Another possibility is that in the config, 'dataset_path' points to a different file than you're saving y_test to ("./y_test.npz").
Hi,
I am having trouble to convert a very simple model for Loihi. I do not see how it is different from your mnist example and I do not know how to tackle this. Could you please help?
The model is
Training with keras works without any problem. However, converting it returns a shape error. I must admit, the configuration is still a black-box for me. So here is the configuration I copied from a tutorial and the function with which I start the conversion:
Here's the complete output on the console, including training. Any idea what the reason is?