Running a python script with heavy memory requirements I need to run a python script where I am loading several(~15) large modules including keras and load several (approx 20) LSTM models and large amount of data for computation. These script has several methods which are needed to build an environment class for a reinforcement learning problem. The process seems to be working very slowly on my 16GB RAM i7 CPU(haven't tried out multiprocessing module yet but might not work as most of the task is not parallelism friendly.) Can you provide me some alternative possibly going for a higher end hardware setup ideal for such heavy computations which can be done on a local machine. Since it's a problem I am facing in ML related work which other researchers over here might have faced, that's why I am adding the question in this forum. Please suggest other forums if possible where I can get a better suggestion
Python is by default single-threaded. Read about the Global Interpreter Lock (GIL). Although some modules with utilise multi-threading, asyncronous processing and multicore solutions, these will not take effect when you are simply loading modules and data.

Unless you are using some distributed system, or perhaps something like Tensorflow-serving, you will not be able to train/exectute your 20 LSTM models in parallel in a single Python script, so perhaps you could just load one at a time. Alternatively, just make 20 copies of the script - one for each model - then launch all 20 scripts in different terminals (or via a multi-threaded or multicore script).

Asking on StackOverflow would reach an audience that is more adept in the sorts of problems.