Ayomi Al-noor
Ayomi Al-noor

Reputation: 65

Training Keras models in two seperate juypter notebooks on CPU and GPU

I am training Keras CNN models for two different applications on the Jupyter Notebook. Given that I want to utilize the full resources of my PC, can I use Keras-GPU in one notebook and another notebook using CPU.

I learned that Keras uses GPU by default - if available- and I can force Keras to use CPU as in Can Keras with Tensorflow backend be forced to use CPU or GPU at will?. My question is that by running this line of code,



os.environ['CUDA_VISIBLE_DEVICES'] = '-1'

will the default settings change in all the running notebooks or in that particular notebook only?

Upvotes: 2

Views: 238

Answers (1)

Ioannis Nasios
Ioannis Nasios

Reputation: 8527

by running this line of code,

os.environ['CUDA_VISIBLE_DEVICES'] = '-1'

the default settings change in that particular notebook only

You can use

os.environ['CUDA_VISIBLE_DEVICES'] = ''

to train on CPU

Upvotes: 2

Related Questions