PCA analysis incites memory allocation problem. How to solve this without reducing image resolution or number of images
As this problem stated, you have to reconfigure your system to make more RAM available to the run-time system.
However, I suspect that you can finesse the problem by iterating through the images, rather than loading all of them into one large NumPy array.  Rather than using the monolithic processing tools, you'll need to write code to perform the same computations serially.
using PCA (principle component analysis) to extract features from a set of 4K images giving me the memory error
File "/home/paul90/.local/lib/python3.6/site-packages/sklearn/decomposition/_pca.py", line 369, in fit_transform
    U, S, V = self._fit(X)
MemoryError: Unable to allocate array with shape (23339520, 40) and data type float32
I am trying to extract 30 features (# of components) from 4K images and getting this error.

Pseudocode:

immatrix = np.array([np.array(Image.open(im, 'r')).flatten() for im in file_list], 'f')
x = StandardScaler().fit_transform(immatrix)
pc_train = pca.fit_transform(x)
Filelist is list of images (currently I have 600 images)
I can't reduce the number of images in the list and can't reduce the initial 4K resolution. In this context,how can I solve this memory allocation issue?
It will be a great help if anyone can tell me the steps to avoid the memory issues.