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

SyntaxError loading the model #1

Open
aralroca opened this issue May 5, 2018 · 1 comment
Open

SyntaxError loading the model #1

aralroca opened this issue May 5, 2018 · 1 comment

Comments

@aralroca
Copy link

aralroca commented May 5, 2018

I tried to do the example from scratch, but on the line:

this.model = await tf.loadModel('/assets/model.json');

I'm getting this error:

SyntaxError: Unexpected token < in JSON at position 0

In my assets folder I just copy/pasted the same assets that this repo:

assets
├── group1-shard1of1
├── group2-shard1of1
├── group3-shard1of2
├── group3-shard2of2
├── group4-shard1of1
└── model.json

And the file that contains the line:

this.model = await tf.loadModel('/assets/model.json');

is in the same level than assets.

Any idea about why is happening this? I would like to load the model 😄

Thanks!

@aralroca
Copy link
Author

aralroca commented May 5, 2018

Sorry, my mistake. Was because instead of on the same folder, in my example the assets needs to be inside /public.

The error message was a little bit confusing 😄

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

1 participant