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

Cannot read property 'tensor' of undefined #106

Open
lemoustachiste opened this issue Feb 2, 2018 · 1 comment
Open

Cannot read property 'tensor' of undefined #106

lemoustachiste opened this issue Feb 2, 2018 · 1 comment

Comments

@lemoustachiste
Copy link

lemoustachiste commented Feb 2, 2018

Hi,

I've been struggling all morning with this issue, and I can't seem to figure out why it fails.
I have a model of which the input is of Dense type.
As I predict, I receive the error in the title, breaking on that line: https://github.com/transcranial/keras-js/blob/master/src/Model.js#L579

I looked in depth, I have 9 model layers defined, according to the original model I defined with the bin file. The last layer seems to be correctly set as the outputLayer.

If I inspect all my layers, only the first one (the input) has an output key. The rests do not, including obviously the outputLayer.

I am a bit at a loss here, since I have limited knowledge of ML in general and Keras in particular. Is there anything that has been done wrong in my initial definition of layers? Or something else that I'd be missing in a configuration?

Thanks for the help

@hepesu
Copy link

hepesu commented Mar 26, 2018

Maybe you run your prediction too early. You can bind "initProgress" event to see whether the model is initialized or not. If the model is not fully initialized, it would throw this error.

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

2 participants