Why was Python killed when it reached this function?

I’m working on a deep learning project consisting of a dataset of 45000 images.

When I load the file and the computer reaches the following function my computer throws the error “killed”. Why am I getting this message? And how to solve it?

Here is the function that I’m talking about:

imgs = []
for i in range(len(images)): #len(images)=45406
    img = cv2.imread(images[i]).astype(np.uint8)[:,:,::,-1]
    img = img.astype(np.float32)/255

Here ‘images’ is an array consisting of image paths.

Read more here: https://stackoverflow.com/questions/64939351/why-was-python-killed-when-it-reached-this-function

Content Attribution

This content was originally published by Wukz at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: