Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute error: sequential model has no loss function #49

Closed
roshan-gopalakrishnan opened this issue Nov 19, 2019 · 3 comments
Closed

Comments

@roshan-gopalakrishnan
Copy link

I am training a custom dataset using Keras on GPU and uses categorical cross entropy. I am using keras multi GPU datagenerator function to load the data from sub directories. While conversion, SNN toolbox is showing Attribute error: sequential model has no loss function. Could you help me ? Is that due to datagenerator function ? Should I load the dataset similar to MNIST or CIFAR-10 examples ?

@rbodo
Copy link
Contributor

rbodo commented Nov 23, 2019

The datagenerator should work fine in SNN toolbox, I've used it regularly for ImageNet and other datasets.

Do you get the same error also under different conditions (e.g. using one of the example scripts)? I would need to see more details to be able to help with this (error stack trace, network architecture / training script).

@delpie
Copy link

delpie commented Nov 29, 2019

Hi Bodo,

Roshan and I are in the same team.
We are able to run the Keras trained .h5 model in snntoolbox using INI.
However we encountered an error during weight normalisation. Wonder what
happpend. Below is the message: Rgds Del
Building parsed model...

Compiling parsed model...

Normalizing parameters...
Traceback (most recent call last):
File "/home1/ncp/anaconda2/bin/snntoolbox", line 11, in
sys.exit(main())
File "/home1/ncp/anaconda2/lib/python2.7/site-packages/snntoolbox/bin/run.py", line 50, in main
test_full(config)
File "/home1/ncp/anaconda2/lib/python2.7/site-packages/snntoolbox/bin/utils.py", line 95, in test_full
normalize_parameters(parsed_model, config, **normset)
File "/home1/ncp/anaconda2/lib/python2.7/site-packages/snntoolbox/conversion/utils.py", line 147, in normalize_parameters
scale_fac = scale_facs[layer.name]
KeyError: '00Conv2D_64x64x16'

@rbodo
Copy link
Contributor

rbodo commented Nov 30, 2019

Hmm, the toolbox tries to load scale factors from a previous run from disk, to save computation time. If the user changed the network architecture in the same working directory, it can lead to a mismatch with the saved dict. Try deleting the normalization folder in your working dir.

@rbodo rbodo closed this as completed Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants