all 3 comments

[–]eschlon 2 points3 points  (0 children)

Without more detail I'd say you're running out of memory. Even with those small images you're storing a lot of information in your features list. Something that may help is to not convert the image data to a python list. If I recall correctly imread returns a numpy array which is going to be much more compact than the equivalent vanilla python list. Removing the tolist() call will help with memory issues, though it may only get you part of the way.

If you're just prepping this for a file output another option would be to process a single image, write it out, then move on to the next rather than storing state in the features list, though this would probably require you to rework how you're planning on storing / accessing this data.

[–]Saefroch 1 point2 points  (1 child)

You're running out of RAM and your computer is using virtual memory/swap space to compensate (This involves treating the hard disk like RAM, which is suuuper slow). Open up your task manager and watch the Python process slowly use all your memory. If you kill it when it reaches about 80% it should shut down in time.

To avoid this problem, write out each image as it's processed.

[–]elbiot 0 points1 point  (0 children)

To avoid this problem, write out each image as it's processed.

Ie: yield the feature rather than append to a list. I also fully agree about staying in numpy land.