transcranial / keras-js

Run Keras models in the browser, with GPU support using WebGL
https://transcranial.github.io/keras-js
MIT License
4.96k stars 501 forks source link

Why does this model not run in mobile Chrome and mobile Safari? #42

Open goodmansasha opened 7 years ago

goodmansasha commented 7 years ago

Just made a toy example of an insult dector using a character level CNN: https://keras-predict-r.c9users.io/insults.html

The F1 score on the validation set is around 0.65, so it's not great but it works for many insults. It was trained on a small Kaggle insult dataset of around 3,500 examples.

It will take up to 10 seconds to load the first time, and a text form field will appear. The form appears after the model Promise says the model is ready.

In the mobile version, the problem is that never detects any insults that are detected in the non-mobile version on my laptop (desktop chrome and safari both work).

The weights are around 10mb, so I'm guessing this has to do with memory, unless it could be a gpu issue.

P.S. I did just notice this issue as well: https://github.com/transcranial/keras-js/issues/6

goodmansasha commented 7 years ago

The script uses at maximum 12 mb screenshot_robo

Prediction times are pretty snappy given this quite large network with millions of parameters. About 60 ms.

transcranial commented 7 years ago

@predict-r Yeah, there are issues with mobile browsers, particularly on ios. Been meaning to investigate, but haven't had the time to yet.

stekaiser commented 7 years ago

I am also experiencing issues when trying to run the demos or one of my models on iOS with GPU enabled.

The error I am getting is Bound framebuffer is not complete at keras.js:10533. My guess is that it is a weblas related error (see https://github.com/waylonflinn/weblas/issues/30) but that is all I can contribute on this error.

@transcranial any ideas on this?