CNN MemoryError

MemoryError: Out of normal MicroPython Heap Memory! Please reduce the resolution of the image you are running this algorithm on to bypass this issue!

it’s seem that the network(about 164KB) i trained is too large?
I want know the appropriate value of the image amount i use to train net and the image resolution i should make(3232 or 6464),What’s more,the amount of the layer i have to train to

Best wishes

Ibrahim will get back to you with an answer. The M7 the MP heap is only 128KB. So, your network is bigger than all the heap that we have. Ibrahim will try to give you a good estimate on the size of the net that can fit in the M7. This CNN feature is mostly only going to be possible on the H7 coming soon.

Hi, yes 164KBs is larger than the F7’s heap which is only ~52K (and 240KBs on the H7). The network is allocated on the heap, so it needs to be less than 52KBs (for example, the reduced is ~33KBs). There’s no restriction on the number of layers, you can have as many as you want as long as they fit the memory. Smaller training images will reduce the size of the network, but the image size used for inference is irrelevant (it’s allocated in a different memory).
Note if your network is generic and you’d like to share it please send a PR or attach it here and I’ll add it to the repo.

Um, for the number of layer and image input size I’d try to stick to 32x32 or 24x24 and keep the layer count to about 3 to 4 layers of conv.

Thanks,and the network i trained I think it can throw away after i test it,Emmm, by the way, i think m7 is more prefer haarcascade than network.

Anyways, thanks a lot;