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

AttributeError: ‘Model’ object has no attribute ‘output_layers’ in nnvm/frontend/keras.py #1391

Closed
aswinjohn opened this issue Jul 6, 2018 · 3 comments

Comments

@aswinjohn
Copy link
Contributor

https://github.com/dmlc/tvm/blob/941f684614bb643258986fff256f1310587471b3/nnvm/python/nnvm/frontend/keras.py#L526

Google cached solution: https://webcache.googleusercontent.com/search?q=cache:E4rBauh661UJ:https://discuss.tvm.ai/t/compile-keras-model-issue-report-and-solution-included/256+&cd=1&hl=en&ct=clnk&gl=us

outsym = symtab.get_var(model._output_layers[0].name + ':0')
must be
outsym = symtab.get_var(model.layers[-1].name + ':0')

@kazum
Copy link
Contributor

kazum commented Jul 6, 2018

Which backend are you using for Keras? As I wrote in the link, TVM supports Keras with the tensorflow backend only for now. See also #1392.

Anyway, I think further discussion should be moved to https://discuss.tvm.ai/ .

@tqchen
Copy link
Member

tqchen commented Jul 6, 2018

This is mainly due to keras versions, if you update to latest keras version it should be fine

@tqchen tqchen closed this as completed Jul 6, 2018
@schliffen
Copy link

I've got similar error:
AttributeError: 'Model' object has no attribute '_network_nodes'
which was due to Keras version conflict, choosing version 2.3 resolved the issue.

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

4 participants