Model missing in Scratch 3

232 views
Skip to first unread message

Derek Howard

unread,
Sep 1, 2022, 9:40:47 AM9/1/22
to Machine Learning for Kids
Good morning,
I have used ML for Kids pretty extensively in the past with no issues but this morning I had classes working on "Car or Cup" and we all consistently were getting errors from Scratch 3 that "It looks like you don't have a Machine Learning Model" however the model is present on the MLforKids site and appropriately classifies when you use the "Test with Drawing" option. I also did the Pokemon Images project just to test if it was a one off error but I am having the same problem with that project.
Here is what the dev console shows as the error:
MLforKidsError.png
Any advice would be greatly appreciated,
Derek Howard

Dale Lane

unread,
Sep 1, 2022, 10:11:24 AM9/1/22
to Machine Learning for Kids
Sorry about this!

Thanks for the description - that was very helpful. I understand what is happening, so I need to fix this. I'll start having a look into it this evening and post an update here on my progress.

I'm so sorry for the inconvenience! 

Kind regards

D

Dale Lane

unread,
Sep 1, 2022, 10:16:30 AM9/1/22
to Machine Learning for Kids
PS - thanks for letting me know. 
This will have been caused by some changes that went in last night, and I had no idea that this was broken as a result - so it's super useful that you gave me a heads-up

Derek Howard

unread,
Sep 1, 2022, 10:41:58 AM9/1/22
to Machine Learning for Kids
No problem! Thanks for getting back to me so quickly.

Dale Lane

unread,
Sep 1, 2022, 4:06:05 PM9/1/22
to Machine Learning for Kids
Trying to get Scratch to access the ML model trained in the main site is a lot more complicated than I'd like (for various reasons too boring to go into here unless someone is really interested!). 

In the interest of providing a quick workaround, I've added a new Scratch block for "train new machine learning model" which will let you train a new ML model for image projects from inside Scratch - to avoid it needing to access the models created in the main site.
new-block.png


Scratch will save models when it trains them, so you'll only need to use that the first time you open a project. 

If you want to be sure that you're only training a model when you really need to, you could do something fancy like this:
only-train-if-needed.png
But to be honest, it's probably just easiest to click on the "train new machine learning model" block when you know you want to train a model. 

Hopefully that helps you get around the problem for now. 

Sorry again for breaking this, and thanks so much for letting me know.

Kind regards

D

PS - Please note - you'll likely need to clear your browser cache then refresh the page to pick up these updates

Dale Lane

unread,
Sep 3, 2022, 7:03:39 PM9/3/22
to Machine Learning for Kids
Trying to get Scratch to access the ML model trained in the main site is proving more or less impossible, so I've added another workaround - for image projects, when Scratch first opens the Scratch extension will now:

- check to see if Scratch has previously trained a model for this project - if it has, it loads it from the browser storage
- if there isn't a previous model, it attempts to train a new model immediately

This will mean that, as long as there are enough training examples in the project, it means projects won't need to use the "train new machine learning model" block

Nektarios Kokolakis

unread,
Sep 4, 2022, 6:28:38 AM9/4/22
to Machine Learning for Kids
trining the model from scratch does not seem to work either

Honza Soukup

unread,
Sep 4, 2022, 7:38:32 AM9/4/22
to Machine Learning for Kids
neither to me :( 

Dale Lane

unread,
Sep 4, 2022, 8:46:41 AM9/4/22
to Machine Learning for Kids
@Honza - I've recently fixed an issue that Nektarios reported in a separate thread. It may be the same issue that you saw - would you mind trying again, please?

If you still have an issue, please start a new thread with the problem you're seeing

dy Kwon

unread,
Sep 4, 2022, 12:20:45 PM9/4/22
to Machine Learning for Kids
Keep repeating "ready to use" 
The "add training data costume image car(cup) "  block works fine.
 The value of "recognise image costume image (label)" block is values always "unknow".
001.png
It worked fine until last month, but not since a few days ago.

2022년 9월 4일 일요일 오후 9시 46분 41초 UTC+9에 Dale Lane님이 작성:

Dale Lane

unread,
Sep 4, 2022, 12:32:06 PM9/4/22
to Machine Learning for Kids
@dy Kwon

Please try clearing your browser cache. 

A few other thoughts:

1) you say that this worked until last month, but I only added the "train new machine learning model" block for image projects a couple of days ago, so this project can't be more than a couple days old

2) I wouldn't recommend putting the train new model block inside a repeat block. You really don't want to be calling that more than once.

3) I wouldn't recommend putting the recognise-image block inside the repeat-until block. It means that if you already have a model, you don't see any prediction from your model, so I don't think that is really what you want

Honza Soukup

unread,
Sep 4, 2022, 2:31:04 PM9/4/22
to Machine Learning for Kids
Thank you! After clearing my browser cache it works. :) 

Wolfgang Wagner

unread,
Nov 24, 2024, 5:44:37 AM11/24/24
to Machine Learning for Kids
The training model created with https://machinelearningforkids.co.uk/#!/signup is adopted from scratch, but without costumes. 
After loading the Car or Cup project template, other costumes are loaded, not the ones I created.
Is that normal?

Dale Lane

unread,
Nov 24, 2024, 5:46:58 AM11/24/24
to Machine Learning for Kids
I'm not sure what you mean - when you refer to the costumes that you created, what costumes do you mean?

The answer to your question is almost certainly "yes" - the template is a pre-created Scratch project, so that includes costumes. But I'm not clear where else you expected the costumes to come from.

Reply all
Reply to author
Forward
0 new messages