I have 30, 000 pictures now. How can I save them in numpy format?

as mentioned above, I am going to save about 30, 000 pictures in numpy format first, so that it will be much more convenient and faster to use later.

but in the process of running, it seems that there is an error due to insufficient memory, which is reported after reading more than 90 pictures. Here is my code. Is there any problem?

(I used the server of the lab, and the memory is about 10g)

Code:

   

Feb.28,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b331ee-2abb2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b331ee-2abb2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?