ml5js / ml5-library

Friendly machine learning for the web! 🤖
https://ml5js.org
Other
6.5k stars 901 forks source link

Saving #964

Open ncd76 opened 4 years ago

ncd76 commented 4 years ago

Docs say: neuralNetwork.save(?outputName, ?callback);

Code reads:

/**

The params are inverted.

joeyklee commented 4 years ago

@ncd76 - Whoops! This is super helpful to note. I will change this now. Thanks for flagging!

joeyklee commented 4 years ago

UPDATE: wait - which docs are you referring to by chance? Here they seem to be correct https://learn.ml5js.org/docs/#/reference/neural-network?id=save

ncd76 commented 4 years ago

OK I think I've found the issue / confusion:

https://learn.ml5js.org/docs/#/ says the latest is:

https://github.com/ml5js/ml5-library:

So the docs on ml5js.org are current with version 5 but say the latest is 0.4.3

joeyklee commented 4 years ago

@ncd76 - ah-hah! Thanks for tracking this down. Yes, we def. should update this to:

<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js"></script> 

cc/ @bomanimc - I'll try to make a PR shortly!

joeyklee commented 4 years ago

This should now be resolved in our development branch. Just making a note that we need to trigger the build on our documentation website to reflect those changes.

ncd76 commented 4 years ago

No problem, glad to help. I have another saving issue if its OK to tag in on to this thread?

If I save a model with any name other than the default the save works fine and the reference to mymodel.weights.bin is correct in the mymodel.json file but when I try and load back it fails as it tries to load model_meta.json and not mymodel_meta.json. Maybe model_meta.json is not being loaded into memory because its a windows localhost issue?

Is it possible to save and load these files into a database via a js ajax request?

Thanks, Nigel