Brain.js: Brain JS causes Google Chrome to become unresponsive

Created on 14 Nov 2019  路  3Comments  路  Source: BrainJS/brain.js

What is wrong?

When Brain JS is training, Google Chrome browser tab becomes unresponsive/crashes and only becomes responsive again after training is complete, which could take many minutes.

Where does it happen?

When running in Google Chrome from index.html file

How do we replicate the issue?

  1. Copy contents from code example into a *.html file locally on Macbook: https://codepen.io/sts-ryan-holton/pen/RwweqEX
  2. Run in browser

How important is this (1-5)?

5

Expected behavior (i.e. solution)

The browser tab should remain responsive during training as deploying Brain JS to a production site could cause the whole browser tab to crash on slower systems.

Other Comments

discussion needs more info

Most helpful comment

Training is computationally expensive, so you should try to train the network offline (or on a Worker) and use the toFunction() or toJSON() options to plug the pre-trained network into your website.

There are following ways to avoid this:

All 3 comments

Training is computationally expensive, so you should try to train the network offline (or on a Worker) and use the toFunction() or toJSON() options to plug the pre-trained network into your website.

There are following ways to avoid this:

@mubaidr I've already looked at both parts of the documentation, and have tried using the JSON feature in another issue I've opened and can't see any difference, please provide a code example on how to use this?

In your case it seems like data is not enough. Network is not able to reach error threshold. Please enable log: true in training option, as specified here: https://github.com/BrainJS/brain.js#training-options

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akii0008 picture akii0008  路  5Comments

omer54463 picture omer54463  路  6Comments

grigori-gru picture grigori-gru  路  4Comments

TomDobbelaere picture TomDobbelaere  路  6Comments

lucaspojo picture lucaspojo  路  5Comments