Memory allocation failed issue on Portenta

Okay that’s good, thanks for clarifying!

I’m on Portenta H7 Vision Shield (LoRa)

Right, that’s what I’d like to avoid too. When I wasn’t using sleep to save power, this wasn’t happening so my initial hypothesis was that the Portenta is probably losing the pointer to the loaded model or maybe the gc.collect() or (as used during testing) gc.enable() deems it inactive in some random allocation and deletes it.

UPDATE

Tried invoking model only once upon boot again. Works fine for a few iterations but then when it goes to sleep and wakes up for iteration, throws an Invoke failed.

PC