Windows set priority trick

If you find yourself fitting a model involving image data and it is taking 100% CPU because of image transformations, but you still want to work on other things. You can run the following script to change all python.exe currently running in parallel to have a processor priority to be Below Normal. Then your other process where you need to work will be at a Normal priority, which the CPU will prioritize and keep responsive. Here is the powershell script:

Get-WmiObject Win32_process -filter ‘name = “python.exe”’ | foreach-object { $_.SetPriority(16384) }