How to run Tensorflow on CPU September 30, 2022 by Tarik You can also set the environment variable to CUDA_VISIBLE_DEVICES="" without having to modify the source code.