Memory allocation failed

General discussion about topics related to OpenMV.
Posts: 20
Joined: Wed Mar 21, 2018 9:02 pm

Memory allocation failed

Postby lab » Wed Dec 19, 2018 4:37 pm

I noticed that my code won't run if I include in the code long lists with numeric entries. I get the following error when press run:

MemoryError: memory allocation failed, allocating 3652 bytes.

Could I save the list as a text file on the board and read the file when I run my code instead?
User avatar
Posts: 4254
Joined: Sun May 24, 2015 2:10 pm

Re: Memory allocation failed

Postby kwagyeman » Thu Dec 20, 2018 2:22 am

Sure, just use the standard

Code: Select all

with open("/file.txt", "r") as file:
And etc. python coding style.

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 5 guests