Mlpclassifier~ crashes on predict after read

Hey there,

I get a consistent crash from [fluid.mlpclassifier~] when I hit it with the predict message right after reading the weights from a json file. It is kind of weird, because it works when I just train and predict after training (without reading). The main patch is cod_db_builder2.maxpat in (181.7 KB). The crashing bit is in [p predict_labels] at the 9th step.

Training always goes fine. During training I have a “callback” saving the best weights into cod_mlp_weights.json.

When I want to predict in [p predict_labels], I first read this json with the best weights, then hit predict then - crash, every time. If I don’t read before predict, everything is fine.

(I am planning to make a separate thread about the actual project, but wanted to open this one for this potential bug(?).)

I’m on Windows 10 using the alpha-8th (newest at the time of writing) version of the Toolbox.

1 Like

@balintlaczko thanks for catching this. It looks like the json serialization for fluid.mlpclassifier isn’t writing the labels out, which is breaking everything. I’ll file an issue…

1 Like

Actually, it is writing the labels, but they’re not getting parsed back in. Same end result, I know (but slightly less awful, because the data isn’t lost for ever).

With such a title as ‘cod classification’ there is no way one can resist that click bait :smiley: (pun intended)

1 Like

that I knew because we checked them in my JSON master test patch. I’m pretty sure I checked the loadback with the same patch when we refactored the json with @groma but this would imply that I didn’t or that I missed it or something. I’ll check it right now.