-
Notifications
You must be signed in to change notification settings - Fork 160
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
Can I export/import the training data? #7
Comments
I'm not sure if this is the correct way to do this, but how I've been doing it is by storing tensor data in storageDB and then retraining the model onLoad. To store tensor data, simply use the .data() method on the tensor: // Clone the existing tensor
// .data() call is asynchronously, so we clone the old tensor
// in case it's disposed of by the time we generate our next tensor
let tensor = oldTensor.clone()
tensor.data().then((data) => {
// Store the tensor
saveTensorToStorageDB(data)
tensor.dispose()
}) Then, to load it back in try something like: let tensorShape = [227, 227, 3]
loadTensorsFromStorageDB.then((trainedData) => {
trainedData.tensors.forEach((tensors, modelClass) => {
tensors.forEach((data) => {
let tensor = deeplearn.tensor(data, tensorShape)
this.classifier.addImage(tensor, modelClass)
tensor.dispose()
})
})
}) You can either download the trained data as a JSON file, save it to localStorage (5MB limit), or save it to StorageDB (50MB limit). You can also save it to Firebase or some other remote store. I wrote about it in more detail (with examples) here: https://learnwithoz.github.io/day-3-model-persistence |
Thank you very much for your advice. |
@champierre hey looking for the same thing, did you ever figure out how to do it? |
@atzin-em I could implement export/import feature on a different project but the mechanysm should be same. Hope that they could help you. download(export) upload(import) |
@champierre Thank you very much, help was greatly appreciated |
@champierre would you happen to know how to also upload photos to the model manually instead of through the webcam? |
@atzin-em It is interesting to try, but I have not yet. |
Hi - I am wondering about this same issue. A lot of the example links above are broken now. Please advise. |
Hi! A simple strategy is saving the model out as a JSON file with data from the classifier, then importing it back in to access the weights. You can read more about this method here: https://js.tensorflow.org/tutorials/model-save-load.html |
hi @mayaman - thanks for the tip, but I am very much a noob. In trying to adapt this boilerplate code specifically, I can't quite pinpoint what they are calling the "model" if I was to apply the code below:
Any ideas? |
Is there any way to save the data and import it? Where can i find the trained data from the teachable machine example? All the links in this thread are dead :( Thank you. |
There is a new release coming later this year that will have this feature! You can read more about it here: https://teachablemachine.withgoogle.com/io19. |
I've seen that, but is there any way to export this now? or how to do that? |
There are a number of ways to save your trained model and also upload that trained model and continue from where you left off. |
Is there a way that I can export/import the training data?
After I trained the class with many images, I want to export(download) the training data and I want to reuse it.
The text was updated successfully, but these errors were encountered: